I have a problem starting a node.js server. The server app was tested on another system and worked perfectly. The error log says that something is wrong with the node-api@ but I was not able to find any solution.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart node-api@
6 info start node-api@
7 verbose unsafe-perm in lifecycle true
8 info node-api@ Failed to exec start script
9 verbose stack Error: node-api@ start: `node server.js`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack at EventEmitter.emit (events.js:110:17)
9 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at ChildProcess.emit (events.js:110:17)
9 verbose stack at maybeClose (child_process.js:1015:16)
9 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid node-api@
11 verbose cwd /Volumes/HDD/Users/…/app/db
12 error Darwin 14.3.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
14 error node v0.12.3
15 error npm v2.9.1
16 error code ELIFECYCLE
17 error node-api@ start: `node server.js`
17 error Exit status 1
18 error Failed at the node-api@ start script 'node server.js'.
18 error This is most likely a problem with the node-api package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node server.js
18 error You can get their info via:
18 error npm owner ls node-api
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
What is wrong with my installation and how can I solve this?
How to solve npm error “npm ERR! code ELIFECYCLE” Step 1: $ npm cache clean --force Step 2: Delete node_modules by $ rm -rf node_modules (rmdir /S /Q node_modules in windows) folder or delete it manually by going into the directory and right-click > delete / move to trash.
/Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_655Z- debug.log Show activity on this post. Step 2: Delete node_modules by $ rm -rf node_modules ( rmdir /S /Q node_modules in windows) folder or delete it manually by going into the directory and right-click > delete / move to trash.
First, clean the npm cache by using the following command. or you can delete it manually by right-clicking on it and select the delete option. Now, re-install the npm packages again by running the below command. Start the development server using the appropriate command, like npm start or npm run dev. It will work successfully without any errors.
Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the todo_app package react, npm ERR! not with npm itself. This above error is occurred due to the node_modules folder is corrupted in your project, to fix it follow the below steps.
Two things you can try here:
node -v
. If they're different, look to upgrade (or indeed downgrade) your installation.node_modules
directory from the project root on your current computer, then run an npm install
to ensure that the binaries that were compiled are compatible with your operating system.I got to this page looking for a solution to a similar error log.
My problem was that I had started the webpack dev server in the background and had forgotten to kill it before asking Node to start it up again.
Try to find the process PID (second column of output)
ps -u [your user name]
Then send the SIGINT signal (2) to the process with the PID
kill -2 [PID]
Hope this helps others that come to this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With