NPM ELIFECYCLE error - using node server.js command
Asked Answered
S

5

26

I am deploying test-bot on ibm watson as described here https://github.com/eciggaar/text-bot and when I am trying to deploy code locally using CLI foundry it is getting the following errors.

I am using Nodejs version 6.10.3 and npm version 5.0.4

can someone please help me with this.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\PRERNA CHUGH\AppData\Roaming\npm-cache\_logs\2017-06-29T13_36_22_995Z-debug.log
Snub answered 30/6, 2017 at 11:24 Comment(2)
Possible duplicate of What does the ELIFECYCLE Node.js error mean?Curtate
Are you receiving any certificate error ?Coracle
K
36

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

Koo answered 30/6, 2017 at 13:6 Comment(0)
C
0

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.

Coracle answered 24/7, 2019 at 9:6 Comment(0)
S
0

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 !!

Sarchet answered 25/7, 2020 at 7:59 Comment(0)
E
-1

In my case, it was my firewall that blocked some program access to internet.

Encaustic answered 25/9, 2021 at 17:15 Comment(0)
A
-4

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

Astigmatism answered 30/7, 2018 at 6:32 Comment(1)
This is related to npm and not related to windows path env variablesCoracle

© 2022 - 2024 — McMap. All rights reserved.