Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm ERR! code ELIFECYCLE (starting issue)

thanks for reading this and helping with the issue.

I am trying to run nodejs on Windows machine and start expo client after installing expo-cli. Initially it worked except that live refresh or any other refresh wouldn't work so I tried to delete, uninstall/reinstall nodejj again and now I can't start the thing at all.

I've tried troubleshooting steps from here: npm ERR! code ELIFECYCLE

but unfortunately they did not help at all...

I don't know if there is a way to perform a fresh install as it may be something that is saved somewhere in cache (even if I delete the directory completely). I'm open to any suggestions here.

Thanks a mil in advance for all your answers and comments.

This is the error from cli:

C:\Users\Sergej\NewProject>npm start

> @ start C:\Users\Sergej\NewProject
> expo start

Starting project at C:\Users\Sergej\NewProject
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class. Run CLI with --verbose flag for more details.

Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ 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\Sergej\AppData\Roaming\npm-cache\_logs\2019-10-31T16_44_26_903Z-debug.log

This is the log file text:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle @~prestart: @
6 info lifecycle @~start: @
7 verbose lifecycle @~start: unsafe-perm in lifecycle true
8 verbose lifecycle @~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Sergej\NewProject\node_modules\.bin;C:\Users\Sergej\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\Sergej\AppData\Local\Microsoft\WindowsApps;C:\Users\Sergej\AppData\Roaming\npm
9 verbose lifecycle @~start: CWD: C:\Users\Sergej\NewProject
10 silly lifecycle @~start: Args: [ '/d /s /c', 'expo start' ]
11 silly lifecycle @~start: Returned: code: 1  signal: null
12 info lifecycle @~start: Failed to exec start script
13 verbose stack Error: @ start: `expo start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @
15 verbose cwd C:\Users\Sergej\NewProject
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.13.0
19 verbose npm  v6.12.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ start: `expo start`
22 error Exit status 1
23 error Failed at the @ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
like image 543
Sergej Dikun Avatar asked Oct 31 '19 17:10

Sergej Dikun


People also ask

What causes npm err code Elifecycle?

The error code ELIFECYCLE means that while npm understood the command you want it to run, something is preventing npm from running that command successfully. To resolve this error, you need to read the complete log message further below the code ELIFECYCLE line.

How do I resolve npm start error?

To solve the Missing script: "start" error, make sure to add a start command to the scripts object in your package. json file and open your shell or IDE in the root directory of your project before running the npm start command.

Why 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 .


2 Answers

So, after spending ridiculous amount of time trying to solve the issue (generally all the steps that I've found were involving reinstalling dependencies in one way or another) I've found the answer.

It turns out that the latest node.js issue has some issues with Windows and the only way to fix this for me was to download previous version. I've downloaded it from:

https://nodejs.org/en/download/releases/

the version that fixed it for me was Node.js 10.x

Quick and painless (almost)

I hope that this will help someone who will be stuck with a similar issue...

like image 164
Sergej Dikun Avatar answered Sep 22 '22 00:09

Sergej Dikun


I had a similar problem, i tried these steps in the first place:

rm -rf node_modules 

rm -rf package-lock.json

npm install

npm start

But nothing worked.

So i digg in the terminal message and found that a babel-eslint dependency was pointing to other project directory different from the one i was working on, then i went to that direction and looked for a node_modules folder, and voila! that was a problem about running npm install where i certainly shouldn't.

A simple rm -rf node_modules in my projects container folder was enough to get everything working on again!

like image 41
Jeyson Mg Avatar answered Sep 24 '22 00:09

Jeyson Mg