首页 文章

反应原生窗口,产生npm ENOENT错误

提问于
浏览
2

我试图在Windows上运行react-native并得到以下错误:

C:\Program Files>react-native init AwesomeProject

这将引导您在C:\ Program Fil es \ AwesomeProject中创建一个新的React Native项目从npm安装react-native软件包... events.js:141 throw er; //未处理的'错误'事件^错误:在onErrorNT的Process.ChildProcess._handle.onexit(internal / child_process.js:178:32)的exports._errnoException(util.js:860:11)处生成npm ENOENT(内部/ child_process.js:344:16)atNTCallback2(node.js:450:9)at at process._tickCallback(node.js:364:17)at Function.Module.runMain(module.js:459:11)at startup( node.js:136:18)在node.js:972:3

我该如何解决?

3 回答

  • 1

    enter image description here

    react-native-cli@0.1.8错误

    回滚react-native-cli@0.1.7

    一切都好 .

  • 1

    这应该在React Native CLI 0.1.9中修复 . 要更新CLI:

    npm uninstall -g react-native-cli
    npm install -g react-native-cli
    

    报告中有0.1.8的回归,报告如下:https://github.com/facebook/react-native/issues/5169

  • 8

    要解决此问题, Reinstall NodeJS https://nodejs.org/en/

    enter image description here

    Then

    npm install -g react-native-cli --vebrose
    react-native init App --verbose
    

    enter image description here

    如果仍然失败,请尝试安装 Python 3 https://www.python.org/并重复此过程 .

相关问题