React native 包装商赢得';开始
我想我在某个时候升级了节点,现在当我尝试使用React native 包装商赢得';开始,react-native,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 Node
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
Node 5.1.0、npm 3.3.12和react native 0.15.0对于IOS应用程序,现在启动打包程序的首选方法似乎是点击xcode本身中的run按钮或使用以下命令:
react native start
我收到了相同的错误
事实证明,这是因为npm在node_模块
中发现了另一个react native
,这是因为它是在一个完全不同的环境中启动的
因此,我将我的package.json
更改为如下:
"scripts": {
"start": "$NVM_BIN/react-native start"
}
我正在使用:
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
}
你有没有按照指示去做
npm uninstall -g react-native
npm install -g react-native-cli
我之所以这么说,是因为我一直在犯安装react native
而不是react native cli
export PATH=“/Users/my mac/Library/Android/sdk/platform tools”:$PATH的错误
/adb反向tcp:8081
/adb启动服务器
/adb设备我已经处于这种情况或几天了,还没有解决方案,所以我不得不降级到Expo@19.0.0,它成功了 如果您愿意遵循我的步骤:
- 在
更新package.json
:devdependency
“jest expo”:“19.0.0”
“反应本机脚本”:“1.0.0”
- 在
更新package.json中
:依赖项
“世博会”:“19.0.0”
- 在
中,将sdkVersion更新为app.json
19.0.0
npm start
或react native start
,它会很好地安装我的应用程序的调试版本,但打包程序不会启动
我发现这是因为另一个进程正在使用我的8081端口
如果您没有在终端中使用
lsof-i tcp:8081
或任何其他工具指定另一个端口,请检查哪些进程正在使用该端口。我发现在XCode中点击run按钮是不够的。如果我没有启动服务器并使用react native start运行,应用程序将无法正常启动。@flyingace-同意,在我的情况下,启动会偶尔失败,或者需要几分钟才能启动。但是,当我在点击run按钮之前显式运行react native时,所有内容都会在几秒钟内成功加载。谢谢,只需直接在命令行下运行react native start,而不是通过“npm run start”委派同一个调用就行了。虽然这确实有效,您可以随意访问由“npm start”创建的npm环境。这不是当前脚本的问题,但是,由于我在多台PC上开发,我已经修改了我的版本,使用Bonjour来发现packager,我唯一能找到应用程序名称的地方是package.json中定义的变量。。。@user552403的答案对我很有用。