npm启动错误。新的本机应用程序反应...未处理的“错误”事件

时间:2018-11-13 17:28:06

标签: node.js react-native npm expo create-react-native-app

第一次使用create-react-native-app后,我在运行“ npm start”时遇到问题。我安装了create-react-native-app全局程序并运行了它。然后,我进入新应用程序并尝试“ npm start”。我得到下面的错误。我还添加了完整的错误日志。我认为我的PATH是问题所在,但我不确定。我正在使用Windows 8.1。非常感谢您的任何建议!

PS C:\Desktop\devout> npm start

> my-new-project@ start C:\Desktop\devout
> expo start

[11:43:43] Starting project at C:\Desktop\devout
[11:43:53] Expo DevTools is running at http://localhost:19002
[11:43:53] Opening DevTools in the browser... (press shift-d to disable)
 events.js:183
  throw er; // Unhandled 'error' event
  ^

Error: spawn cmd ENOENT

at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-new-project@ start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-new-project@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional 
logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\first baptist\AppData\Roaming\npm-cache\_logs\2018-11- 
13T16_44_06_257Z-debug.log

完整日志...

0 info it worked if it ends with ok
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' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle my-new-project@~prestart: my-new-project@
6 info lifecycle my-new-project@~start: my-new-project@
7 verbose lifecycle my-new-project@~start: unsafe-perm in lifecycle true
8 verbose lifecycle my-new-project@~start: PATH: C:\Program 
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp- 
bin;C:\Desktop\devout\node_modules\.bin;C:\Program files\nodejs;C:\Program 
Files\Git\cmd;C:\Program Files 
(x86)\Yarn\bin\;C:\ProgramData\chocolatey\bin;C:\program 
files\git;C:\Users\first baptist\Miniconda3;C:\Users\first 
baptist\Miniconda3\Library\mingw-w64\bin;C:\Users\first 
baptist\Miniconda3\Library\usr\bin;C:\Users\first 
baptist\Miniconda3\Library\bin;C:\Users\first 
baptist\Miniconda3\Scripts;C:\Users\first 
baptist\AppData\Roaming\npm;C:\Program 
Files\heroku\bin;C:\Users\public\software\Microsoft VS 
Code\bin;C:\Users\first baptist\AppData\Local\Yarn\bin 
9 verbose lifecycle my-new-project@~start: CWD: C:\Desktop\devout
10 silly lifecycle my-new-project@~start: Args: [ '/d /s /c', 'expo start' ]
11 silly lifecycle my-new-project@~start: Returned: code: 1  signal: null
12 info lifecycle my-new-project@~start: Failed to exec start script
13 verbose stack Error: my-new-project@ 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:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
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 emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit 
(internal/child_process.js:209:5)
14 verbose pkgid my-new-project@
15 verbose cwd C:\Desktop\devout
16 verbose Windows_NT 6.3.9600
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program 
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v8.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error my-new-project@ start: `expo start`
22 error Exit status 1
23 error Failed at the my-new-project@ start script.
23 error This is probably not a problem with npm. There is likely additional 
logging output above.
24 verbose exit [ 1, true ]

3 个答案:

答案 0 :(得分:1)

试纱... 或安装值班员。

但是我建议将您的节点版本更新为10.0.0 之前

答案 1 :(得分:1)

在启动服务器之前,请查看系统上节点js的当前版本,并检查所有依赖项。我相信问题出在这两个方面。尝试安装所有更新。

答案 2 :(得分:0)

度过我的2天后, 我用这个解决了我的问题。 “%SystemRoot%\ system32;”在PATH变量中。