npm在尝试运行 “npx create-expo-app expoApp” 时出现错误。

huangapple go评论105阅读模式
英文:

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

问题

我正在尝试设置一个Expo项目,但npm无法成功执行。它确实创建了必要的基本文件,如APP.js等,但没有其他操作。

以下是错误本身:

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\_logs23-08-04T18_39_56_835Z-debug-0.log

这是日志文件:

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\_logs23-08-04T18_39_56_835Z-
26 verbose logfile C:\Users\Chingiz\AppData\Local\npm-cache\_logs23-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\_logs23-08-04T18_39_56_835Z-debug-0.log

我正在运行node v18.17.0。

我已经在Google上搜索过,并询问了AI。我得到的所有答案似乎都是正确的,但对我都没有起作用。

英文:

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
ogs23-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\_logs23-08-04T18_39_56_835Z-
26 verbose logfile C:\Users\Chingiz\AppData\Local\npm-cache\_logs23-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\_logs23-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.

答案1

得分: 0

你需要在该位置手动创建一个名为 "npm" 的文件夹:C:\Users\Chingiz\AppData\Roaming\npm

英文:

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

huangapple
  • 本文由 发表于 2023年8月5日 02:48:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76838493.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定