打包机无法启动

rai*_*inz 14 react-native

我想我在某个时候升级了节点,现在当我尝试运行打包器时,npm start它抱怨:

$ npm start
react-native start

Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
Run Code Online (Sandbox Code Playgroud)

节点5.1.0,npm 3.3.12和react-native 0.15.0

rai*_*inz 23

看起来现在为IOS应用程序启动打包程序的首选方法是在xcode本身中按下运行按钮或使用以下命令:

react-native start


use*_*403 9

我正在使用:

"scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
}
Run Code Online (Sandbox Code Playgroud)


plo*_*ard 7

我得到了同样的错误.

事实证明这是因为npm因为react-nativenode_modules一个完全不同的环境中启动而找到另一个内部.

所以我改变了我package.json的样子:

"scripts": {
  "start": "$NVM_BIN/react-native start"
}
Run Code Online (Sandbox Code Playgroud)