[英]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:我试过的:
node_modules
node_modules
npm install
npm install
npm
versionnpm
版本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 install
和npm start
,它工作正常,但我有不知道引擎盖下发生了什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.