Npm Elifecycle Error - Using Node Server.js Command
Solution 1:
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
Solution 2:
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.
Solution 3:
If clearing the cache does not work, this step may. Try and kill the process running on the specific port (let's say 3000). It worked in my situation. Type the below in your terminal and also ensure you are in the correct directory too.
lsof -n -i4TCP:3000 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
Best of luck !!
Solution 4:
In my case, it was my firewall that blocked some program access to internet.
Solution 5:
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.
- Check with echo %PATH%
- And then add it with set PATH=%PATH;
- Then try the installation again
Regards
Post a Comment for "Npm Elifecycle Error - Using Node Server.js Command"