NPM ELIFECYCLE error - using node server.js command

巧了我就是萌 提交于 2019-11-30 04:38:40

Sometimes, when you already started your web server, the ELIFECYCLE error comes if you try to run the npm command again on another terminal (cmd). Make sure that you don't have any other instance running up in the same port.

Try to clean your cache with: npm cache clean with Administrator/root and delete your node_modules, after this steps, try to install your packages again with npm install --save

Check the mappings in package.json file

{ "name": "app", "version": "1.0.0", "description": "", "main": "server.js", "dependencies": {}, "scripts": { "start": "node ." }, "author": "", "license": "ISC" }

Make sure that server.js is present in the app directory

In case you used Windows OS the PATH Environment variable was not including the directory of "node". Check it and add it. Maybe it helps.

  1. Check with echo %PATH%
  2. And then add it with set PATH=%PATH;
  3. Then try the installation again

Regards

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!