简体   繁体   English

npm start 错误:npm start require(...) 不是函数 npm ERR! 代码生命周期

[英]npm start error:npm start require(...) is not a function npm ERR! code ELIFECYCLE

Just start to learn react js and finished some pages, but there is an error when I run "npm start" today.刚开始学习react js,完成了一些页面,但是今天运行“npm start”时出现错误。 I do not change anything since last time... Anyone can help me out?自上次以来我没有改变任何东西......任何人都可以帮助我吗? Thank you.谢谢你。

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

谢谢大家,最后删除src文件夹下的setupProxy.js文件,npm start就可以了。

Please try this one.请试试这个。

  1. Delete nodes_modules删除nodes_modules
  2. npm install -g npm
  3. npm install & npm install -D
  4. npm run start

It seems like you don't have react-scripts in your global environment.try this:您的全球环境中似乎没有反应脚本。试试这个:

npm install -g react-scripts

or或者

npm install --save react react-dom react-scripts

If above doesn't work try this如果以上不起作用试试这个

  1. Delete npm and npm-cache directories... (don't worry you can install npm globally later)删除 npm 和 npm-cache目录...(不用担心你可以稍后全局安装 npm)
  2. Go back to your application directory and remove node_modules folder返回您的应用程序目录并删除node_modules文件夹
  3. Now enter npm install to install the dependencies (delete package-lock.json if it's already created)现在输入npm install安装依赖项(如果已经创建,请删除 package-lock.json)
  4. Now run npm install --save react react-dom react-scripts现在运行npm install --save react react-dom react-scripts
  5. Get it started with npm start使用npm start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM