javascriptnode.jsreact-nativenpmexpo

npm error when trying to run "npx create-expo-app expoApp"


I am trying to setup an expo project put npm fails to do it. It does create necessary base file like APP.js and so on, but nothing else here is the error itself:

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\Chingiz\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\Chingiz\AppData\Roaming\npm'
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: C:\Users\Chingiz\AppData\Local\npm-cache\_l
ogs\2023-08-04T18_39_56_835Z-debug-0.log

and here is the log file:

0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm@9.6.7
2 info using node@v18.17.0
3 timing npm:load:whichnode Completed in 4ms
4 timing config:load:defaults Completed in 7ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 7ms
6 timing config:load:builtin Completed in 8ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:E:\ali\.npmrc Completed in 1ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:C:\Users\Chingiz\.npmrc Completed in 1ms
12 timing config:load:user Completed in 2ms
13 timing config:load:file:C:\Users\Chingiz\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 26ms
17 timing npm:load:configload Completed in 26ms
18 timing npm:load:mkdirpcache Completed in 1ms
19 timing npm:load:mkdirplogs Completed in 1ms
20 verbose title npm exec create-expo-app expoApp
21 verbose argv "exec" "--" "create-expo-app" "expoApp"
22 timing npm:load:setTitle Completed in 15ms
23 timing config:load:flatten Completed in 6ms
24 timing npm:load:display Completed in 7ms
25 verbose logfile logs-max:10 dir:C:\Users\Chingiz\AppData\Local\npm-cache\_logs\2023-08-04T18_39_56_835Z-
26 verbose logfile C:\Users\Chingiz\AppData\Local\npm-cache\_logs\2023-08-04T18_39_56_835Z-debug-0.log
27 timing npm:load:logFile Completed in 21ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 76ms
31 timing arborist:ctor Completed in 1ms
32 silly logfile start cleaning logs, removing 2 files
33 silly logfile done cleaning log files
34 http fetch GET 200 https://registry.npmjs.org/create-expo-app 1698ms (cache revalidated)
35 timing arborist:ctor Completed in 0ms
36 timing command:exec Completed in 1772ms
37 verbose stack Error: ENOENT: no such file or directory, lstat 'C:\Users\Chingiz\AppData\Roaming\npm'
38 verbose cwd E:\ali
39 verbose Windows_NT 10.0.19045
40 verbose node v18.17.0
41 verbose npm  v9.6.7
42 error code ENOENT
43 error syscall lstat
44 error path C:\Users\Chingiz\AppData\Roaming\npm
45 error errno -4058
46 error enoent ENOENT: no such file or directory, lstat 'C:\Users\Chingiz\AppData\Roaming\npm'
47 error enoent This is related to npm not being able to find a file.
47 error enoent
48 verbose exit -4058
49 timing npm Completed in 7351ms
50 verbose code -4058
51 error A complete log of this run can be found in: C:\Users\Chingiz\AppData\Local\npm-cache\_logs\2023-08-04T18_39_56_835Z-debug-0.log

I am running node v18.17.0

I Googled it and asked AI. All the answers I got seemed correct but none worked for me.


Solution

  • You need to manually create a folder called "npm" at that location: C:\Users\Chingiz\AppData\Roaming\npm