【发布时间】:2020-08-25 22:49:31
【问题描述】:
当我尝试在我的 react 应用程序中运行 npm start 时,我收到了这个错误:
$ npm start
> trends@0.1.0 start C:\Users\Administrateur.TEST\Desktop\reactProjects\trends
> react-scripts start
'react-scripts' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! trends@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the trends@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! C:\Users\Administrateur.TEST\AppData\Roaming\npm-cache\_logs\2020-07-20T07_09_04_578Z-debug.log
我尝试了其他解决方案,例如使用清理缓存、删除 node_modules 并再次运行 npm install,但仍然得到相同的错误
【问题讨论】:
-
你能添加你正在使用的
create-react-app的版本吗 -
@Yassine,根据 create-react-app 文档,不要使用
npm install -g create-react-app下载 create-react-app 而是直接使用npx create-react-app运行它 -
是的,我一开始就是这么做的
标签: javascript node.js reactjs npm