我想我在某个时候升级了节点,现在当我尝试运行打包器时,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
我正在使用:
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
}
Run Code Online (Sandbox Code Playgroud)
我得到了同样的错误.
事实证明这是因为npm因为react-native在node_modules一个完全不同的环境中启动而找到另一个内部.
所以我改变了我package.json的样子:
"scripts": {
"start": "$NVM_BIN/react-native start"
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18402 次 |
| 最近记录: |