{"id":108,"hash":"390b9d045864270252b13d88979b5303913a41877bb437f7ce09391b00d90994","pattern":"How to solve npm error &quot;npm ERR! code ELIFECYCLE&quot;","full_message":"I'm trying to learn react, so I have this sample code for the full-stack react voting app, and I am trying to get it to work but after running npm install followed by npm start I receive the following error when I run npm start can anyone help me with this issue:\n\nnpm ERR! Darwin 16.4.0\nnpm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"run\" \"server\"\nnpm ERR! node v7.5.0\nnpm ERR! npm  v4.3.0\nnpm ERR! file sh\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno ENOENT\nnpm ERR! syscall spawn\nnpm ERR! voting_app@1.1.0 server: `live-server --public --    \nhost=localhost --port=3000 --middleware=./disable-browser-cache.js`\nnpm ERR! spawn ENOENT\nnpm ERR!\nnpm ERR! Failed at the voting_app@1.1.0 server script 'live-server --\npublic --host=localhost --port=3000 --middleware=./disable-browser- \ncache.js'.\nnpm ERR! Make sure you have the latest version of node.js and npm  \ninstalled.\nnpm ERR! If you do, this is most likely a problem with the voting_app  \npackage,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     live-server --public --host=localhost --port=3000 --  \nmiddleware=./disable-browser-cache.js\nnpm ERR! You can get information on how to open an issue for this  \nproject with:\nnpm ERR!     npm bugs voting_app\nnpm ERR! Or if that isn't available, you can get their info via:\nnpm ERR!     npm owner ls voting_app\nnpm ERR! There is likely additional logging output above.\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_581Z-\ndebug.log\n\nnpm ERR! Darwin 16.4.0\nnpm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"start\"\nnpm ERR! node v7.5.0\nnpm ERR! npm  v4.3.0\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! voting_app@1.1.0 start: `npm run server`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the voting_app@1.1.0 start script 'npm run server'.\nnpm ERR! Make sure you have the latest version of node.js and npm \ninstalled.\nnpm ERR! If you do, this is most likely a problem with the voting_app    \npackage,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     npm run server\n\nnpm ERR! You can get information on how to open an issue for this   \nproject with:\nnpm ERR!     npm bugs voting_app\nnpm ERR! Or if that isn't available, you can get their info via:\nnpm ERR!     npm owner ls voting_app\nnpm ERR! There is likely additional logging output above.\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_655Z-\ndebug.log\n\nHere is my package.json:\n\n{\n  \"name\": \"voting_app\",\n  \"version\": \"1.1.0\",\n  \"author\": \"Fullstack.io\",\n  \"scripts\": {\n    \"go\": \"open http://localhost:3000; npm run server\",\n    \"e2e\": \"nightwatch\",\n    \"test\": \"./node_modules/.bin/concurrently -k 'npm run server' 'npm  \nrun e2e'\",\n    \"start\": \"npm run server\",\n    \"server\": \"live-server public --host=localhost --port=3000 --  \nmiddleware=./disable-browser-cache.js\"\n  },\n  \"private\": true,\n  \"devDependencies\": {\n  \"concurrently\": \"2.2.0\",\n  \"live-server\": \"git://github.com/acco/live-server.git\"\n},\n  \"dependencies\": {\n  \"semantic-ui\": \"git://github.com/Semantic-Org/Semantic-\n  UI.git#27d58a01793b66318478fbc5b6676804d22d065d\"\n  }\n}\n\nAnd finally my log file:\n\n0 info it worked if it ends with ok\n1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]\n2 info using npm@4.3.0\n3 info using node@v7.5.0\n4 verbose run-script [ 'prestart', 'start', 'poststart' ]\n5 info lifecycle voting_app@1.1.0~prestart: voting_app@1.1.0\n6 silly lifecycle voting_app@1.1.0~prestart: no script for prestart, continuing\n7 info lifecycle voting_app@1.1.0~start: voting_app@1.1.0\n8 verbose lifecycle voting_app@1.1.0~start: unsafe-perm in lifecycle true\n9 verbose lifecycle voting_app@1.1.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/ItsMeMrLi/.rvm/gems/ruby-2.3.1/bin:/Users/ItsMeMrLi/.rvm/gems/ruby-2.3.1@global/bin:/Users/ItsMeMrLi/.rvm/rubies/ruby-2.3.1/bin:/Users/ItsMeMrLi/.cargo/bin:/usr/local/Cellar/smlnj/110.74/libexec/bin:/usr/local/bin:/Users/ItsMeMrLi/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Downloads/geckodriver:/usr/local/bin:/Users/ItsMeMrLi/.rvm/bin\n10 verbose lifecycle voting_app@1.1.0~start: CWD: /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app\n11 silly lifecycle voting_app@1.1.0~start: Args: [ '-c', 'npm run server' ]\n12 silly lifecycle voting_app@1.1.0~start: Returned: code: 1  signal: null\n13 info lifecycle voting_app@1.1.0~start: Failed to exec start script\n14 verbose stack Error: voting_app@1.1.0 start: `npm run server`\n14 verbose stack Exit status 1\n14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)\n14 verbose stack     at emitTwo (events.js:106:13)\n14 verbose stack     at EventEmitter.emit (events.js:192:7)\n14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)\n14 verbose stack     at emitTwo (events.js:106:13)\n14 verbose stack     at ChildProcess.emit (events.js:192:7)\n14 verbose stack     at maybeClose (internal/child_process.js:890:16)\n14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)\n15 verbose pkgid voting_app@1.1.0\n16 verbose cwd /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app\n17 error Darwin 16.4.0\n18 error argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"start\"\n19 error node v7.5.0\n20 error npm  v4.3.0\n21 error code ELIFECYCLE\n22 error errno 1\n23 error voting_app@1.1.0 start: `npm run server`\n23 error Exit status 1\n24 error Failed at the voting_app@1.1.0 start script 'npm run server'.\n24 error Make sure you have the latest version of node.js and npm installed.\n24 error If you","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"Step 1: $ npm cache clean --force\n\nStep 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. If you are not updating your packages you can delete the package-lock.json file too.\n\nStep 3: npm install\n\nTo start again,\n$ npm start \n\nThis worked for me. Hope it works for you too.\n\nWhile above suggests re-creating package-lock.json file, ensure package-lock.json file exists to begin with, and is tracked by VCS/Git (if the project has VCS).\n\nPS: Still if it's still there, kindly check the error it is displaying in red and act accordingly. This error is specific to node.js environment.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/42308879/how-to-solve-npm-error-npm-err-code-elifecycle","votes":505,"created_at":"2026-04-19T04:41:20.062264+00:00","updated_at":"2026-04-19T04:51:03.644652+00:00"}