栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

npm ERR!在project@0.0.1启动脚本'react-native start'处失败

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

npm ERR!在project@0.0.1启动脚本'react-native start'处失败

我在ubuntu中遇到了同样的问题,对我有用的是我关闭的终端从重新启动的USB中删除了我的设备。首先建议您将这些行添加到package.json中,用以下命令替换脚本

"scripts": {"prepare-repository": "npm i -g react-native-cli yarn;yarn install; react-native link","emulator": "emulator -avd Nexus5V6L23_x86_64 -scale 1.0","install": "react-native run-android","start": "react-native start --reset-cache","android": "npm run install && npm run start","clean": "watchman watch-del-all && npm cache clean && cd android && ./gradlew clean && cd ..","test": "jest"}

之后,将其保存,然后转到创建项目的文件夹。假设我的住所/工作区/演示。在运行脚本中

npm run clean this will clear all cache

之后

npm run android

它将在设备以及启动重置缓存中运行应用程序。让我知道它是否有帮助。

编辑!!!有时在运行npm run android之前添加adb reverse tcp:8081会执行tricj



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/436762.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号