node.js - "Error: spawn cmd ENOENT"在 Expo 初始化项目中

标签 node.js react-native npm expo enoent

我正在使用

启动一个新的 React-Native 项目

expo init firstexpo

但是我在命令提示符处收到此错误

错误:spawn cmd ENOENT

PS C:\Users\Alex\testing\firstexpo> expo start
[16:21:09] Starting project at C:\Users\Alex\testing\firstexpo
[16:21:11] Expo DevTools is running at http://localhost:19002
[16:21:11] Opening DevTools in the browser... (press shift-d to disable)
Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
PS C:\Users\Alex\testing\firstexpo>

npm 启动错误找不到模块“opn”

[16:38:49] Starting project at C:\Users\Alex\testing\firstexpo
[16:38:52] Expo DevTools is running at http://localhost:19002
[16:38:52] Opening DevTools in the browser... (press shift-d to disable)
[16:38:52] Cannot find module 'opn'
[16:38:52] Set EXPO_DEBUG=true in your env to view the stack trace.
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\Alex\AppData\Roaming\npm-cache\_logs\2018-11-24T08_38_52_344Z-debug.log

我对编码很陌生,谁能告诉我如何解决这个问题? 非常感谢。

Downgrade to v28

最佳答案

我用这个解决了我的错误。 “%SystemRoot%\system32;”在 PATH 变量中。

关于node.js - "Error: spawn cmd ENOENT"在 Expo 初始化项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53456639/

相关文章:

node.js - REST API 端点命名

node.js - 什么是 app.configure ('production' )

javascript - npm 包中的事件监听器在哪里定义?

node.js - 放大 cli : npm ERR! 超出最大调用堆栈大小

node.js - NPM 无法安装模块,mkdir 拒绝权限

javascript - 如何获取 Json 文档数组中数组的索引

javascript - .push( ) 没有更新变量

apache - 将支付信息发送到服务器的最佳方式是什么?

node.js - 需要 EventEmitter 与 Node 和 React-Native 兼容

git - 参数列表太长 - lint-staged -> tslint