[英]npm start cause error React native is not installed
I want to learn React Native and start from [Facebook Github][1], So have installed the node.js V8.114 , then run below command on command prompt 我想学习React Native并从[Facebook Github] [1]开始,所以已经安装了node.js V8.114,然后在命令提示符下运行以下命令
npm install -g create-react-native-app
create-react-native-app AwesomeProject
cd AwesomeProject
npm start
Everything went right, but when I run the npm start
, this error caused: 一切正常,但是当我运行
npm start
,此错误导致:
Error: React native is not installed.
错误:未安装React native。 Please run
npm install
in your project directory.请在您的项目目录中运行
npm install
。 16:36:21: Error starting packager: Error: Couldn't start project.16:36:21:启动打包程序时出错:错误:无法启动项目。 Please fix the errors and restart the project.
请更正错误,然后重新启动项目。 at C:\\xdl\\src\\Project.js:1329:11 at Generator.next () at step (C:\\Users\\Riazati\\AwesomeProject\\node_modules\\xdl\\build\\Project.js:1735:191) at C:\\Users\\Riazati\\AwesomeProject\\node_modules\\xdl\\build\\Project.js:1735:361 at npm ERR!
在步骤C(\\:Users \\ Riazati \\ AwesomeProject \\ node_modules \\ xdl \\ build \\ Project.js:1735:191)在Generator:next()在C:\\ xdl \\ src \\ Project.js:1329:11 \\ Users \\ Riazati \\ AwesomeProject \\ node_modules \\ xdl \\ build \\ Project.js:1735:361在npm ERR! code ELIFECYCLE npm ERR!
代码ELIFECYCLE npm ERR! errno 1 npm ERR!
errno 1 npm错误! AwesomeProject@0.1.0 start:
react-native-scripts start
npm ERR!AwesomeProject@0.1.0开始:
react-native-scripts start
npm ERR! Exit status 1 npm ERR!退出状态1 npm ERR! npm ERR!
npm ERR! Failed at the AwesomeProject@0.1.0 start script.
在AwesomeProject@0.1.0启动脚本处失败。 npm ERR!
npm ERR! This is probably not a problem with npm.
npm可能不是问题。 There is likely additional logging output above.
上面可能还有其他日志记录输出。
Can anyone help me? 谁能帮我?
确保您已更新npm install -g npm@latest
删除文件夹,然后重新运行构建过程
尝试运行npm install
,就像错误消息告诉您那样。
cd到项目后,尝试运行“ npm install”或“ yarn”,然后可以尝试运行“ react-native run-ios”或“ react-native run-android”
Deleting node modules
and then run npm install
or yarn install
worked for me!! 删除
node modules
,然后运行npm install
或yarn install
对我有用! Cheers. 干杯。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.