Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to exec start script - EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)

Tags:

node.js

npm

I have installed node 8.10 and downgrade to npm 4 because i have error message with npm 5.

*******************************************************************************
ERROR: npm 5 is not supported yet

Then I use the command to downgrade npm npm install -g npm@4.

So I create my projet

$>npm install -g create-react-native-app
$>create-react-native-app AwesomeProject
$>cd AwesomeProject
$>npm start

And then I have the following error message.

> [email protected] start /private/var/root/AwesomeProject
> react-native-scripts start

09:42:16: Unable to start server
See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
  sudo sysctl -w kern.maxfiles=5242880
  sudo sysctl -w kern.maxfilesperproc=524288

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-native-scripts start`
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!     /var/root/.npm/_logs/2018-03-23T08_42_16_152Z-debug.log

I have a look to the logfile

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 lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/private/var/root/AwesomeProject/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
10 verbose lifecycle [email protected]~start: CWD: /private/var/root/AwesomeProject
11 silly lifecycle [email protected]~start: Args: [ '-c', 'react-native-scripts start' ]
12 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `react-native-scripts start`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at EventEmitter.emit (events.js:214:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at ChildProcess.emit (events.js:214:7)
14 verbose stack     at maybeClose (internal/child_process.js:925:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid [email protected]
16 verbose cwd /private/var/root/AwesomeProject
17 verbose Darwin 17.2.0
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 verbose node v8.10.0
20 verbose npm  v4.6.1
21 error code ELIFECYCLE
22 error errno 1
23 error [email protected] start: `react-native-scripts start`
23 error Exit status 1
24 error Failed at the [email protected] start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Have you an idea?

Best regard.

like image 416
xduris Avatar asked Mar 23 '18 09:03

xduris


People also ask

How do I fix Elifecycle error?

To solve this, it is possible to start again on a healthy basis by reinstalling all the modules used by the application, and by emptying the NPM node package manager cache. The "npm cache clean" command clears the npm cache. Add the "--force" argument to force the operation.

Why is my npm start not working?

Check the ignore-script config If you see the start script is present inside your package. json file but still can't run the script, you need to check the console output. If there's no output at all, then you may have the ignore-scripts npm configuration set to true .


1 Answers

Try these steps:

  1. npm install -g npm@latest to update npm because it is sometimes buggy.
  2. rm -rf node_modules to remove the existing modules.
  3. npm install to re-install the project dependencies.
like image 73
lordvcs Avatar answered Sep 28 '22 04:09

lordvcs