-对不起,我的英语不好。 -我是这个REACT NATIVE的新手。当我以admin身份在cmd上单击“ npm start”时,出现以下错误。 -我花了几个小时进行修复,但似乎没有任何变化。谢谢你们对我的帮助。
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\ASUS\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ASUS\package.json'
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\ASUS\AppData\Roaming\npm-cache\_logs\2020-09-21T17_54_27_222Z-debug.log
-``这是文件日志。
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.14.6
3 info using node@v12.18.4
4 verbose config Skipping project config: C:\Users\ASUS/.npmrc. (matches userconfig)
5 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\ASUS\package.json'
6 verbose cwd C:\Users\ASUS
7 verbose Windows_NT 10.0.18363
8 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
9 verbose node v12.18.4
10 verbose npm v6.14.6
11 error code ENOENT
12 error syscall open
13 error path C:\Users\ASUS\package.json
14 error errno -4058
15 error enoent ENOENT: no such file or directory, open 'C:\Users\ASUS\package.json'
16 error enoent This is related to npm not being able to find a file.
17 verbose exit [ -4058, true ]
答案 0 :(得分:0)
您需要转到项目文件夹并从此处开始npm。例如,如果您在C:\ MyAwesomeProject中初始化了项目,那么您将需要位于同一文件夹中。
答案 1 :(得分:0)
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.14.6
3 info using node@v12.18.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle @~prestart: @
6 info lifecycle @~start: @
7 verbose lifecycle @~start: unsafe-perm in lifecycle true
8 verbose lifecycle @~start: PATH: C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-
bin;C:\Users\ASUS\d13cnpm2\node_modules\.bin;C:\Program Files\Common
Files\Oracle\Java\javapath;C:\Program Files (x86)\Common
Files\Oracle\Java\javapath;C:\Windows\System32;C:\Program Files\nodejs\;C:\Program
Files\MySQL\MySQL Shell
bin\;C:\Users\ASUS\.dotnet\tools;C:\Windows\System32;C:\Users\ASUS\AppData\Roaming\npm
9 verbose lifecycle @~start: CWD: C:\Users\ASUS\d13cnpm2
10 silly lifecycle @~start: Args: [ '/d /s /c', 'expo start' ]
11 silly lifecycle @~start: Returned: code: 1 signal: null
12 info lifecycle @~start: Failed to exec start script
13 verbose stack Error: @ start: `expo start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:286:5)
14 verbose pkgid @
15 verbose cwd C:\Users\ASUS\d13cnpm2
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.18.4
19 verbose npm v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error @ start: `expo start`
22 error Exit status 1
23 error Failed at the @ start script.
23 error This is probably not a problem with npm. There is likely additional logging
output above.
24 verbose exit [ 1, true ]
谢谢,但仍然出错,今天的文件日志会这样,idk为什么