3

I am trying to run this react app: https://github.com/JackHeTech/multiplayer-chess-game

It works when I download the repo and do npm install and then npm start.

But when I try to make the project myself using create-react-app with these steps:

npx create-react-app frontend
*copy the required files from repo to frontend folder*
npm install <p1> <p2> ...
npm start

That doesn't work and shows these errors:

Compiling...
C:\Users\username\Documents\Projects\chess_server\frontend\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

[Error: ENOENT: no such file or directory, stat 'C:\Users\username\Documents\My Music'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'C:\\Users\\username\\Documents\\My Music'
}
PS C:\Users\username\Documents\Projects\chess_server\frontend> 

Why is it pointing to 'C:\Users\username\Documents\My Music'? I have not used that path anywhere in my files.

Basically I am trying to recreate the project from the repo on my own. But it's giving me the error given above.

Het
  • 203
  • 1
  • 3
  • 15

4 Answers4

2

I ran into the same error, and the problem was that i was importing something without actually installing the npm package. In my case, it was react-router-dom. Double check that you've actually installed all your dependencies that you've used in your code with npm install --save <your dependency>

Jay Pillai
  • 148
  • 8
0

It is indeed odd that it references My music. Did try npm install inside the project folder? If so, try deleting package.json and running npm install again.

Edit: Also found this:

I was also plagued by this error, and after trying all the other answers, magically found the following solution:

Delete package-lock.json and the node_modules folder, then run npm install again.

If that doesn't work, try running these in order:

npm install npm cache clean --force npm install -g npm npm install

and then re-deleting the above files and re-running npm install.

Worked for me!

Azpil
  • 36
  • 5
0

Only do this when you don't see a build folder after pushing to GitHub again

it will work if you run: npm run build -- This should create a build folder

Before you run: npm run deploy

-3

Please remove the space between your folder name "My Music" to either "My_Music" or "My-Music" or "MyMusic" or whatever you like (but WITHOUT SPACE). The issue here is as it detects space it will try to find path till My only and consider other members as attributes may be (I am not quite sure )

It does not convert the path with encoding tahts the issue.

NOTE: Keep the practice to not add space in name of folder.

Apoorva Chikara
  • 8,277
  • 3
  • 20
  • 35
Van
  • 1,225
  • 10
  • 18