简体   繁体   English

没有找到匹配的文件...。 (ReactJS)

[英]No matching files ... were found. (ReactJS)

so I tried to run npm start on my react app.所以我尝试在我的npm start应用程序上运行npm start But It's not running, instead it responds like this:但它没有运行,而是这样响应:

'/Users/macintoshhd/iCloud Drive (Archive)/Documents/Abu Abdillatief/Self Study/vetme/src/.' '/Users/macintoshhd/iCloud Drive (Archive)/Documents/Abu Abdillatief/Self Study/vetme/src/.' were found.被找到。

Can anybody help?有人可以帮忙吗? In previous projects everything runs fine, and I tried to run other previous projects again that has no .在以前的项目中一切运行良好,我尝试再次运行其他没有. file in src folder, it ran well, no problems. src文件夹中的文件,它运行良好,没有问题。 Plus, this one also has no .另外,这个也没有. file in src folder as well. src文件夹中的文件也是如此。

I dont know if .我不知道. refers to index.js or any other files, but it clearly has no different when it comes to files contained within src when initializing npx create-react app ... or create-react-app ... .指的是index.js或任何其他文件,但在初始化npx create-react app ...create-react-app ...时,对于包含在src文件,它显然没有什么不同。

What I've tried:我试过的:

  • Delete node_modules删除node_modules
  • Re-run npm install重新运行npm install
  • Update npm version更新npm版本

I hope this information could help in finding solutions, I cant quite see the problem myself, thank you.我希望这些信息可以帮助找到解决方案,我自己看不到问题,谢谢。

I face the problem also, and found this link https://github.com/facebook/create-react-app/issues/9902我也面临这个问题,发现这个链接https://github.com/facebook/create-react-app/issues/9902

There mentioned that your directory path shouldn't have any space, since the last react update.有提到你的目录路径不应该有任何空间,因为上次反应更新。

C:\Desktop\React App (BootCamp)\myApp> npm start

After I removed the space from the directory path, it still doesn't works.从目录路径中删除空间后,它仍然不起作用。

C:\Desktop\ReactApp(BootCamp)\myApp> npm start

Then I tried to remove the parenthesis also... and it works.然后我也尝试删除括号......并且它有效。

C:\Desktop\ReactAppFromBootCamp\myApp> npm start

在删除src目录中的所有内容后,我遇到了同样的问题,我所要做的就是使用ctrl+c停止服务器,然后使用npm start来解决这个问题。

It's very weird, I had the same issue with a new project I created and there is no way to make it work.这很奇怪,我在创建的新项目中遇到了同样的问题,并且无法使其正常工作。 The solution for me was to copy all the files from a working project (instead of creating a new react app) and then it ran fine.我的解决方案是从一个工作项目中复制所有文件(而不是创建一个新的 React 应用程序),然后它运行良好。

Having the same problem... it happens to me when I run create-react-app in a particular folder.遇到同样的问题......当我在特定文件夹中运行 create-react-app 时,它发生在我身上。 it doesn't happens when I run it a in a new directory.. still trying to figure it out.当我在一个新目录中运行它时它不会发生......仍在试图弄清楚它。

anyway..反正..

I tried to move around this new react app folder to any path that doesn't contain archive in its directory, it runs well (even though its parent folders has space in its name).我试图将这个新的 react 应用程序文件夹移动到其目录中不包含archive任何路径,它运行良好(即使其父文件夹的名称中有空格)。

But, my previous projects are located inside a path which contains archive , it runs fine too, so I'm not sure if these are due to the latest changes React made or something in that nature.. but at least it runs now and I can continue building my portfolio.但是,我以前的项目位于包含archive的路径中,它也运行良好,所以我不确定这些是否是由于 React 所做的最新更改或类似性质的更改.. 但至少它现在运行,我可以继续建立我的投资组合。

Hope this runs on your machine too :)希望这也能在你的机器上运行:)

I have the same problem when I created a new app recently using create-react-app tool.我最近使用 create-react-app 工具创建了一个新应用程序时遇到了同样的问题。 Maybe the problem is the path of the folder which includes the react app is too long, or some special characters in the path.也许问题是包含 react 应用程序的文件夹的路径太长,或者路径中有一些特殊字符。 When I put my app into a new folder which has a short and simple path, it works.当我将我的应用程序放入一个具有简短路径的新文件夹时,它可以工作。 A new problem caused by new updates.新更新引起的新问题。

I guess this is a problem with the new version of React (it has been updated from 16.13.1 to 17. **. **).我猜这是React新版本的问题(已经从16.13.1更新到17.**.**)。

I took from my old file "package.json" " " dependencies ": {" react ":" ^ 16.13.1 "," react-dom ":" ^ 16.13.1 "," react-scripts ":" 3.4. 3 "...}我从我的旧文件 "package.json" " " dependencies ": {" react ":" ^ 16.13.1 "," react-dom ":" ^ 16.13.1 "," react-scripts ":" 3.4. 3 "...} " dependencies ": {" react ":" ^ 16.13.1 "," react-dom ":" ^ 16.13.1 "," react-scripts ":" 3.4. 3 "...} , removed all files from "src" but did not touch "app.js" and "index.js" and used npm i & npm start . " dependencies ": {" react ":" ^ 16.13.1 "," react-dom ":" ^ 16.13.1 "," react-scripts ":" 3.4. 3 "...} ,从 "src" 中删除了所有文件,但没有触及 "app.js" 和 "index.js" 并使用npm i & npm start

The application started, but I had a problem - there was no "import React from 'react'" in "App.js".应用程序启动了,但我遇到了一个问题——“App.js”中没有“从 'react' 导入 React”。 check this option.选中此选项。

根据 git hub 问题,他们提到“您的目录路径不应该有任何空间”,但在我的情况下它仍然不起作用,一旦我将应用程序移至桌面并npm installnpm start ,它工作正常,但我有不知道引擎盖下发生了什么。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “没有找到与模式“src”匹配的文件。” 使用“npx eslint src”或“npx eslint src/”时 - "No files matching the pattern "src" were found." when using "npx eslint src" or "npx eslint src/" 未找到与该模式匹配的文件:“'**/*.js'” - No files matching the pattern were found: "'**/*.js'" 找不到 npx 命令。 对于 reactJS - npx command not found. For reactJS 找不到与“xxx.js”匹配的文件中的错误 - ERROR in No files matching 'xxx.js' were found 错误:找不到与模式“'./src/views/{tokens,atoms,molecules,organisms}/**/*.scss'”匹配的文件 - Error: No files matching the pattern "'./src/views/{tokens,atoms,molecules,organisms}/**/*.scss'" were found GSAP 和 ReactJs。 控制台警告:未找到 GSAP 目标未定义。 & 未找到 GSAP 目标 - GSAP & ReactJs. Console warnings: GSAP target undefined not found. & GSAP target not found 未找到具有提供的路径的文件:build. 不会上传任何工件。 - Github 将 React 应用程序部署到 Firebase 的操作 - No files were found with the provided path: build. No artifacts will be uploaded. - Github Action for deploying React App to Firebase Typeorm + Firebase 功能:部署后“No connection options were found in any orm configuration files” - Typeorm + Firebase functions: “No connection options were found in any orm configuration files” after deployed firebase 包已成功找到。 这个包本身指定了一个无法解析的“主”模块字段。 这些文件都不存在 - firebase package was successfully found. this package itself specifies a `main` module field that could not be resolved. none of these files exist 如果未找到映像,则反应更新状态。 - React update state if image not found.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM