[英]npm start reactjs, won't start, react-scripts: command not found
所以我正在尝试学习React。 今天以前从未使用过它,只学习了几门课程。 我一直按照reactjs.org上的说明设置单个页面应用程序。 我一直在运行npm start
并遇到错误。 所以,恼火的是,我做了一些研究,更新了npm和node.js(npm现在是v5.6.0,node现在是9.4.0),仍然出现相同的错误。 现在,我找不到任何答案,并且完全无法理解为什么npm start
不起作用。
Jonathans-MBP:src jonathankuhl$ npm start
> my-app@0.1.0 start /Users/jonathankuhl/Documents/HTML:CSS Practice/react test/my-app
> react-scripts start
sh: react-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! my-app@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jonathankuhl/.npm/_logs/2018-01-26T19_59_09_179Z-debug.log
Jonathans-MBP:src jonathankuhl$ cd ./
Jonathans-MBP:src jonathankuhl$ ls
App.css index.js
App.js logo.svg
App.test.js registerServiceWorker.js
index.css
Jonathans-MBP:src jonathankuhl$ cd ..
Jonathans-MBP:my-app jonathankuhl$ ls
README.md package-lock.json public
node_modules package.json src
Jonathans-MBP:my-app jonathankuhl$
任何帮助,将不胜感激。
看来您没有安装react-script,在npm start
之前进行npm install
,或者如果仍无法解决,请npm install react-scripts --save
以安装它们,它应该对其进行修复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.