Cant install create-react-app

Im trying to install react-create-app, but i get this errormessage (im running windows 10) :

$ npx create-react-app my-app
npm ERR! code ENOENT
npm ERR! syscall spawn C:\Program Files\nodejs
npm ERR! path C:\Users\chubl
npm ERR! errno -4058
npm ERR! enoent spawn C:\Program Files\nodejs ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\chubl\AppData\Local\npm-cache_logs\2022-02-04T09_56_50_091Z-debug-0.log

Ive tried:

  • Reinstalling node
  • Run the command both in Git-bash and regular command line
  • Reading all the posts here and on stackoverflow

But i havent found anyone with the same errorcode or with a solution that works for me :frowning:

Please help!!

Have you looked at the debug log ?

Have you installed Node globally? Or do you know where it got installed? It’s expecting to find it in the C:\Program Files\nodejs folder. Check what you have in there.

Like so:

Yepp, it doesent really make me smarter but here it is :
0 verbose cli [
0 verbose cli ‘C:\Program Files\nodejs\node.exe’,
0 verbose cli ‘C:\Users\chubl\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js’,
0 verbose cli ‘exec’,
0 verbose cli ‘–’,
0 verbose cli ‘create-react-app’,
0 verbose cli ‘my-app’
0 verbose cli ]
1 info using npm@8.4.1
2 info using node@v16.13.2
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\chubl\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\chubl.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\chubl\AppData\Roaming\npm\etc\npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:validate Completed in 0ms
15 timing config:load:credentials Completed in 1ms
16 timing config:load:setEnvs Completed in 0ms
17 timing config:load Completed in 9ms
18 timing npm:load:configload Completed in 9ms
19 timing npm:load:setTitle Completed in 0ms
20 timing config:load:flatten Completed in 3ms
21 timing npm:load:display Completed in 3ms
22 verbose logfile C:\Users\chubl\AppData\Local\npm-cache_logs\2022-02-06T06_33_51_854Z-debug-0.log
23 timing npm:load:logFile Completed in 6ms
24 timing npm:load:timers Completed in 0ms
25 timing npm:load:configScope Completed in 0ms
26 timing npm:load Completed in 19ms
27 silly logfile start cleaning logs, removing 1 files
28 http fetch GET 200 999ms (cache revalidated)
29 timing arborist:ctor Completed in 0ms
30 timing arborist:ctor Completed in 0ms
31 timing arborist:ctor Completed in 0ms
32 timing command:exec Completed in 1079ms
33 verbose stack Error: spawn C:\Program Files\nodejs ENOENT
33 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
33 verbose stack at onErrorNT (node:internal/child_process:477:16)
33 verbose stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
34 verbose cwd C:\Users\chubl
35 verbose Windows_NT 10.0.19043
36 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Users\chubl\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “exec” “–” “create-react-app” “my-app”
37 verbose node v16.13.2
38 verbose npm v8.4.1
39 error code ENOENT
40 error syscall spawn C:\Program Files\nodejs
41 error path C:\Users\chubl
42 error errno -4058
43 error enoent spawn C:\Program Files\nodejs ENOENT
44 error enoent This is related to npm not being able to find a file.
44 error enoent
45 verbose exit -4058
46 timing npm Completed in 1507ms
47 verbose code -4058
48 error A complete log of this run can be found in:
48 error C:\Users\chubl\AppData\Local\npm-cache_logs\2022-02-06T06_33_51_854Z-debug-0.log

Hmm i think so… I use a swedish version of Windows 10. So when i hit the explorerer tab it says “C:\Program Files\nodejs”
but when im in the tree like your picture it looks like this :

Hmmm. I don’t know much at all about internationalization in Windows, so I’m not really sure what to suggest. So is there no “Program Files” directory at all?

I wonder what would happen if you created a “Program Files” folder and copied that nodejs folder into it? I feel like this is kind of a hacky and temporary fix (if it even works). But it’s the only idea I have.

Thanks for the suggestion!

When trying to make an “Program FIles” directory, it tells me there is allready such a map and asks if i want to override it… So i guess it translates the folders display-name “Program FIles” to “Program”(swedish), but the folders actual directory name is “Program Files”…