简体   繁体   中英

npm start not working on computer with different node and npm

i have 2 computers, while i am sharing one react application. One computer is running the React app just fine; the other, not so much. Their configurations are slightly different.

Computer 1, macbook (react app is starting):

  • node: v13.11.0
  • npm 6.13.7

Computer 2, ubuntu 18.04 (react app is not starting):

  • node: v10.16.0
  • npm: 6.14.4

computer 2 gets the following error when running npm start:

the error is followed by the following info:

在此处输入图片说明

i have run npm install and npm start again, but to be honest, the differing versions were just my best guess. It is also not a port issue, as i have switched the ports, as per a recommendation. Would be very grateful to anybody who could help me run the code properly on computer 2!

ps. in the past, i have run react apps totally fine on the linux. thanks again!

As of your problem, you have to update your package.JSON before running in machines with different versions of anything. Or you have to downgrade your npm version as well as you node version, else you'll get these kinds of errors for sure.

Try this in all your computers.

>sudo npm install npm@latest -g

This should definitely solve your problem. Please verify if all your packages in both machines are of same versions, if not please do update those too. Hope it helps!.. Happy Coding!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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