反应原生运行Expo时出错|未处理的错误事件

时间:2019-02-12 21:57:37

标签: react-native expo

当我的应用突然停止工作时,我只是在使用expo开发本机应用。

当我尝试重新启动应用程序时,好像expo已从计算机中删除,因为在运行expo start时收到错误消息:

'expo' is not recognized as an internal or external command,
operable program or batch file.

然后当我运行npm install

它似乎确实完成了最后的说明

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

audited 14262 packages in 23.291s
found 2 vulnerabilities (1 low, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details

但是当我运行Npm start

我被问到一个问题:

This command requires Expo CLI.
Do you want to install it globally [Y/n]?

我回复Y

然后回复:

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
    at onErrorNT (internal/child_process.js:406:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12)
    at onErrorNT (internal/child_process.js:406:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! empty-project-template@ start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the empty-project-template@ 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\Volks-laptop\AppData\Roaming\npm-cache\_logs\2019-02-12T21_37_46_094Z-debug.log

我尝试删除package-lock.json文件并运行npm install

我尝试删除Node_module文件夹并运行npm install

我都尝试过并运行npm install

什么原因导致此错误?我该如何解决?

**我期望什么? **

当我运行Expo start我的博览会CLI来开始工作

1 个答案:

答案 0 :(得分:0)

奇怪的是,我发现一则帖子说,重启笔记本电脑并运行expo cli install命令后,重启笔记本电脑会有所帮助