简体   繁体   中英

No matching files ... were found. (ReactJS)

so I tried to run npm start on my react app. But It's not running, instead it responds like this:

'/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. Plus, this one also has no . file in src folder as well.

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 ... .

What I've tried:

  • Delete node_modules
  • Re-run npm install
  • Update npm version

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

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.

Having the same problem... it happens to me when I run create-react-app in a particular folder. 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).

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.

Hope this runs on your machine too :)

I have the same problem when I created a new app recently using create-react-app tool. Maybe the problem is the path of the folder which includes the react app is too long, or some special characters in the path. 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. **. **).

I took from my old file "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 .

The application started, but I had a problem - there was no "import React from 'react'" in "App.js". check this option.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM