Why does node.js install two 'node_modules' folders? - node.js

Whenever I try to run npm install or npm start I get this error:
bash: line 0: cd: packages/react-scripts: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aristophanes#1.0.0 start: `cd packages/react-scripts && node bin/react-scripts.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aristophanes#1.0.0 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\Aristophanes\AppData\Roaming\npm-cache\_logs\2018-11-09T12_14_19_704Z-debug.log
I've no idea why I started getting it. Can anyone shed some light? I've tried uninstall and installing again but it doesn't help. Also, I don't know why but node.js installs 2 node_modules folders in my computer - one in my C://Program Files/nodejs/ directory and another in C://Users/Aristophanes/. The two package.json files in each are different.
Error log:
0 info it worked if it ends with ok
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' ]
2 info using npm#6.4.1
3 info using node#v10.13.0
4 verbose config Skipping project config: C:\Users\Aristophanes/.npmrc. (matches userconfig)
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info lifecycle aristophanes#1.0.0~prestart: aristophanes#1.0.0
7 info lifecycle aristophanes#1.0.0~start: aristophanes#1.0.0
8 verbose lifecycle aristophanes#1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle aristophanes#1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Aristophanes\node_modules\.bin;C:\Program Files\cmder\bin;C:\Program Files\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Program Files\cmder\vendor\conemu-maximus5;C:\Program Files\cmder\vendor\conemu-maximus5\ConEmu;C:\Program Files\nodejs;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Boxstarter;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Go\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Users\Aristophanes\Go\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\Aristophanes\AppData\Local\Programs\Python\Python37;C:\Users\Aristophanes\AppData\Local\Programs\Python\Python37\Scripts;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\PHP;C:\ProgramData\chocolatey\bin;C:\Program Files\Geth;C:\HashiCorp\Vagrant\bin;C:\Program Files\Git\cmd;C:\composer;C:\Users\Aristophanes\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Users\Aristophanes\AppData\Roaming\local\bin;C:\Users\Aristophanes\AppData\Local\Microsoft\WindowsApps;C:\Users\Aristophanes\AppData\Local\atom\bin;C:\Users\Aristophanes\AppData\Local\Microsoft\WindowsApps;C:\Users\Aristophanes\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Aristophanes\AppData\Local\GitHubDesktop\bin;C:\Users\Aristophanes\AppData\Roaming\Composer\vendor\bin;C:\Program Files\nodejs\bin;C:\Users\Aristophanes\AppData\Roaming\npm;C:\Program Files\Git\mingw64;C:\Program Files\Git\usr\bin;C:\Program Files\cmder
10 verbose lifecycle aristophanes#1.0.0~start: CWD: C:\Users\Aristophanes
11 silly lifecycle aristophanes#1.0.0~start: Args: [ '-c',
11 silly lifecycle 'cd packages/react-scripts && node bin/react-scripts.js start' ]
12 silly lifecycle aristophanes#1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle aristophanes#1.0.0~start: Failed to exec start script
14 verbose stack Error: aristophanes#1.0.0 start: `cd packages/react-scripts && node bin/react-scripts.js start`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
14 verbose stack at EventEmitter.emit (events.js:182:13)
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
14 verbose stack at ChildProcess.emit (events.js:182:13)
14 verbose stack at maybeClose (internal/child_process.js:962:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
15 verbose pkgid aristophanes#1.0.0
16 verbose cwd C:\Users\Aristophanes
17 verbose Windows_NT 10.0.17134
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 verbose node v10.13.0
20 verbose npm v6.4.1
21 error code ELIFECYCLE
22 error errno 1
23 error aristophanes#1.0.0 start: `cd packages/react-scripts && node bin/react-scripts.js start`
23 error Exit status 1
24 error Failed at the aristophanes#1.0.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

The one in C://Program Files/nodejs is the global packages that you are installing.
The one in the project are the dependencies for the project.
And this problem is probably ocurring because you are running npm install on a folder without a package.json.

I think you are having this challenge because you are not in your project folder navigate into your project folder then do your installation .just cd then the name of your app and press the enter key
// like this:
PS C:\Users\Alice\Desktop\project-folder> cd react-app

I haven't sourced any explainer as to why the two node_modules. Noticing that the one in ./Program Files/nodejs are default pkgs while those in my Users dir are 3rd party added via npm. Noticing also in the latter the presence of package-lock.json which will lock the version while the former contains only package.json.

Related

After switching from one react project to another npm start throws error: The system cannot find the path specified. npm ERR! code ELIFECYCLE

Hey guys figured this place would most likely be able to help me.
So i have 2 react projects project A and project B
Whenever i run project B and then finish and try to run project A(npm start) i get error react-scripts error.
Also it only happens to project A, project B can be re run as many times as i want with no error.
I get following error:
$ npm start
> react-only-template#0.1.0 start E:\projects\project-a
> react-scripts start
The system cannot find the path specified.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-only-template#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-only-template#0.1.0 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:
Log file:
0 info it worked if it ends with ok
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' ]
2 info using npm#6.14.11
3 info using node#v10.24.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle react-only-template#0.1.0~prestart: react-only-template#0.1.0
6 info lifecycle react-only-template#0.1.0~start: react-only-template#0.1.0
7 verbose lifecycle react-only-template#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle react-only-template#0.1.0~start: PATH: C:\Users\neman\AppData\Roaming\nvm\v10.24.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\projects\project-a\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\neman\bin;C:\Users\neman\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\neman\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Git\cmd;C:\Program Files\Microsoft VS Code\bin;C:\ProgramData\ComposerSetup\bin;E:\xampp\php;E:\php-7.4.7;E:\Vagrant\bin;%NVM_HOME%;%NVM_SYMLINK%;C:\ProgramData\chocolatey\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\neman\AppData\Local\Microsoft\WindowsApps;C:\Users\neman\AppData\Roaming\Composer\vendor\bin;C:\Users\neman\AppData\Roaming\npm;C:\Users\neman\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle react-only-template#0.1.0~start: CWD: E:\projects\project-a
10 silly lifecycle react-only-template#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle react-only-template#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle react-only-template#0.1.0~start: Failed to exec start script
13 verbose stack Error: react-only-template#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\neman\AppData\Roaming\nvm\v10.24.0\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\neman\AppData\Roaming\nvm\v10.24.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid react-only-template#0.1.0
15 verbose cwd E:\projects\project-a
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.24.0
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error react-only-template#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the react-only-template#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
node version 10.24.0
npm: 6.14.11
Also react scripts are not installed globally!
project A:
Is CRA app
"react": "^17.0.1",
"react-scripts": "^4.0.0",
Project B:
Is also CRA app
"react": "^16.13.1",
"react-scripts": "^3.4.3",
Only way I can run project A again is if I restart my PC which is really really panful as I have to re-run docker and a lot of other apps.
I would appreciate anyone who has any suggestions on how to solve this permanently or at least make it so I don't have to restart my computer
This things happens. Have you tried deleting node_moduled, package-lock.json and run this command ? npm cache clean --force

React native error while running a sample application on a device

I tried to install the reactive native in windows 10, then I created a sample project and try to run it on a device but I am getting error and was unable to load to the device.
I tried most of all the areas mentioned in stack overflow, bot still unable to load the app to the device.
When I run that I got the message as
**
# start C:\Users\Bodha PC - 1\Videos\rn\revi-proj
expo start Starting project at C:\Users\Bodha PC - 1\Videos\rn\revi-proj 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\Bodha PC -
1\AppData\Roaming\npm-cache_logs\2019-10-29T05_23_21_908Z-debug.log
The log file content is 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 npm#6.12.0 3 info
using node#v13.0.1 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\Bodha
PC -
1\Videos\rn\revi-proj\node_modules.bin;C:\Python27\;C:\Python27\Scripts;"C:\Program
Files (x86)\Common Files\Oracle\Java\javapath;C:\Program
Files\Java\jdk1.8.0_221\bin;C:\Program
Files\Java\jre1.8.0_221\bin";C:\Program Files (x86)\Intel\Intel(R)
Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R)
Management Engine
Components\iCLS\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program
Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program
Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files
(x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program
Files\Intel\Intel(R) Management Engine
Components\IPT;C:\Python27\Scripts;C:\Program
Files\Java\jre1.8.0_221\bin;C:\Python27;C:\ProgramData\chocolatey\bin;C:\Program
Files\nodejs\;c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools;C:\Program
Files\Intel\WiFi\bin\;C:\Program Files\Common
Files\Intel\WirelessCommon\;C:\Users\Bodha PC -
1\AppData\Local\watchman;C:\Users\Bodha PC -
1\AppData\Local\Microsoft\WindowsApps;C:\Users\Bodha PC -
1\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program
Files\JetBrains\PyCharm Community Edition 2019.2.1\bin;C:\Users\Bodha
PC - 1\AppData\Roaming\npm 9 verbose lifecycle #~start: CWD:
C:\Users\Bodha PC - 1\Videos\rn\revi-proj 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. (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. (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:1028:16) 13 verbose
stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:283:5) 14 verbose pkgid # 15 verbose cwd
C:\Users\Bodha PC - 1\Videos\rn\revi-proj 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 v13.0.1 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 ]
**
I tried most of all steps as told by others in stackoverflow, but still not working
The screen when I try it on a device is shown below,
So can any one help me with this.
enter image description here

Why does my webpack project fail to build when i clone from github repo?

So I had an old version of a project on one machine in regards to a project that is a github repo being worked on using a different machine.
So I deleted the folder of the old version on the first machine (backed up to a local folder beforehand). Then I did git pull origin master to pull the project from the github repo. I did npm install, npm audit fix and npm audit -f fix to get rid of vulnerabilities.
This project uses webpack and vue-cli so I put npm run dev into the terminal and now I'm getting an error without any information about why the error is happening.
Here is the github repo, follow the steps I just described to reproduce.
https://github.com/adamcole123/pharaoh-web-app
Thanks in advance!
EDITS:
I feel like it may be something to do with global dependencies, but i have no idea what they would be. So if anyone knows that would be great :)
(i forgot to add the error that i got):
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pharaoh-web-app#1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pharaoh-web-app#1.0.0 dev 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\Adam\AppData\Roaming\npm-cache\_logs\2019-04-06T14_44_39_545Z-debug.log
and the debug log it references:
0 info it worked if it ends with ok
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 'run',
1 verbose cli 'dev' ]
2 info using npm#6.4.1
3 info using node#v10.15.3
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle pharaoh-web-app#1.0.0~predev: pharaoh-web-app#1.0.0
6 info lifecycle pharaoh-web-app#1.0.0~dev: pharaoh-web-app#1.0.0
7 verbose lifecycle pharaoh-web-app#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle pharaoh-web-app#1.0.0~dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\nodeprojects\pharaoh-web-app\node_modules\.bin;C:\Users\Adam\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Calibre2\;C:\Program Files (x86)\Brackets\command;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\MATLAB\R2018b\runtime\win64;C:\Program Files\MATLAB\R2018b\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\Adam\AppData\Local\Microsoft\WindowsApps;C:\Users\Adam\AppData\Local\Programs\Python\Python37-32;C:\Program Files\MongoDB\Server\4.0\bin;;C:\Users\Adam\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Adam\AppData\Roaming\npm
9 verbose lifecycle pharaoh-web-app#1.0.0~dev: CWD: C:\nodeprojects\pharaoh-web-app
10 silly lifecycle pharaoh-web-app#1.0.0~dev: Args: [ '/d /s /c',
10 silly lifecycle 'webpack-dev-server --inline --progress --config build/webpack.dev.conf.js' ]
11 silly lifecycle pharaoh-web-app#1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle pharaoh-web-app#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: pharaoh-web-app#1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
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:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
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:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid pharaoh-web-app#1.0.0
15 verbose cwd C:\nodeprojects\pharaoh-web-app
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v10.15.3
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error pharaoh-web-app#1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
22 error Exit status 1
23 error Failed at the pharaoh-web-app#1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Please try .\node_modules\.bin\eslint (the path separator is \ on Windows) or eslint-cli.
I think this will help you:
https://github.com/eslint/eslint/issues/10176

react-native node dependency install broke project

I am trying to develop my first android app using react-native and expo for testing, on windows 8.1.
Working from a tutorial I had a working project using react-native components but everything broke when I installed a dependency with
`npm install --save react-navigation`:
npm-start returned
Error: React native is not installed. Please run 'npm install' in your project directory.
So I ran npm-install again as suggested.
This led to npm-start asking me if I want to install expo-cli globally, and whether I answer yes or no I get the following error:
Installing the package [expo-cli][1]...
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! empty-project-template# start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the empty-project-template# 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\me\AppData\Roaming\npm-cache\_logs\2018-09-25T21_27_21_053Z-debug.log
The log mentioned in this message is as follows:
0 info it worked if it ends with ok
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' ]
2 info using npm#6.4.1
3 info using node#v10.11.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle empty-project-template#~prestart: empty-project-template#
6 info lifecycle empty-project-template#~start: empty-project-template#
7 verbose lifecycle empty-project-template#~start: unsafe-perm in lifecycle true
8 verbose lifecycle empty-project-template#~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\androidProjects\MoviesAndMe\node_modules\.bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\libnvvp;C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Skype\Phone\;C:\Android;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\me\Documents\Latex\miktex\bin\;C:\Users\me\AppData\Local\atom\bin;C:\Users\me\AppData\Local\hyper\app-2.0.0\resources\bin;C:\Program Files\Java\jdk1.8.0_181\bin;C:\Users\me\AppData\Roaming\npm
9 verbose lifecycle empty-project-template#~start: CWD: D:\androidProjects\MoviesAndMe
10 silly lifecycle empty-project-template#~start: Args: [ '/d /s /c', 'expo start' ]
11 silly lifecycle empty-project-template#~start: Returned: code: 1 signal: null
12 info lifecycle empty-project-template#~start: Failed to exec start script
13 verbose stack Error: empty-project-template# 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:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
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:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid empty-project-template#
15 verbose cwd D:\androidProjects\MoviesAndMe
16 verbose Windows_NT 6.3.9600
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.11.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error empty-project-template# start: `expo start`
22 error Exit status 1
23 error Failed at the empty-project-template# start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I searched on StackOverflow and followed the advice to deal with ELIFECYCLE errors found in this answer. runnning npm cache clean then deleting the node_modules directory and package-lock.json buit the error is the same.
I even tried doing these steps as well as removing the react-navigation from my dependencies in my package.json file and in my code before running npm-install again, but it didn't change anything.
It is interesting to note that when running expo start on it's own it manages to launch the bundler and the devtools in the browser just not with the right ip address.
I also don't know if this is important but when running npm-install I get 2 vulnerabilities, when I run npm-audit it indicates that the is a low 'Prototype Pollution' vulnerability in the lodash package and a High 'Denial of Service' vulnerability in the ws package. But nothing changes even after running npm audit fix
Anyway I hope you can help me, thanks!
I was having the same problem.
If you run:
npm i expo-cli
and then
npm start
It will work
In my case, angular-cli was not installed so I ran the command as -
npm install -g angular-cli

ELIFECYCLE npm error

This is the error in my console
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! sedona#0.1.0 start: `npm run build && gulp serve`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the sedona#0.1.0 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\User\AppData\Roaming\npm-cache\_logs\2017-07-21T19_40_30_516Z
-debug.log
This is the "debug.log" file from AppData/Roaming etc. path
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#5.3.0
3 info using node#v8.2.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle sedona#0.1.0~prestart: sedona#0.1.0
6 info lifecycle sedona#0.1.0~start: sedona#0.1.0
7 verbose lifecycle sedona#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle sedona#0.1.0~start: PATH: D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\User\Desktop\user.github.io\node_modules\.bin;C:\Users\User\Desktop\cmder\bin;C:\Users\User\Desktop\cmder\vendor\git-for-windows\cmd;C:\Users\User\Desktop\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Users\User\Desktop\cmder\vendor\conemu-maximus5;C:\Users\User\Desktop\cmder\vendor\conemu-maximus5\ConEmu;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Calibre2\;C:\Program Files (x86)\Skype\Phone\;D:\Program Files\nodejs\;C:\Users\User\AppData\Roaming\npm;C:\Users\User\Desktop\cmder\vendor\git-for-windows\usr\bin;C:\Users\User\Desktop\cmder\vendor\git-for-windows\usr\share\vim\vim74;C:\Users\User\Desktop\cmder\
9 verbose lifecycle sedona#0.1.0~start: CWD: C:\Users\User\Desktop\user.github.io
10 silly lifecycle sedona#0.1.0~start: Args: [ '/d /s /c', 'npm run build && gulp serve' ]
11 silly lifecycle sedona#0.1.0~start: Returned: code: 3221225477 signal: null
12 info lifecycle sedona#0.1.0~start: Failed to exec start script
13 verbose stack Error: sedona#0.1.0 start: `npm run build && gulp serve`
13 verbose stack Exit status 3221225477
13 verbose stack at EventEmitter.<anonymous> (D:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:289:16)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at EventEmitter.emit (events.js:213:7)
13 verbose stack at ChildProcess.<anonymous> (D:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at ChildProcess.emit (events.js:213:7)
13 verbose stack at maybeClose (internal/child_process.js:921:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid sedona#0.1.0
15 verbose cwd C:\Users\user\Desktop\user.github.io
16 verbose Windows_NT 6.1.7601
17 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v8.2.1
19 verbose npm v5.3.0
20 error code ELIFECYCLE
21 error errno 3221225477
22 error sedona#0.1.0 start: `npm run build && gulp serve`
22 error Exit status 3221225477
23 error Failed at the sedona#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]
I have already downloaded another gulp-sass projects from other peolpe github's and replace it contains with my own html-sass-js-img files. Error still here btw.
I have already reinstall cmder and node.js. Twice. Error still here.
I have already delete "node-modules" folder from my project and made "npm i" command - nothing changed.
And one fun thing - files in folder "build" updated like always (if you manual lauch them in browser like in old times). But in root folder seems like gulp-sass just don't see that anything happen and zero changes displayed in localhost 3000.
My previous build from yesterday work fine (seemingly) and builds from another people from github work fine too, but why my new build with some changes make that crash??? Only cause sass files changed?
So, there's an interesting cause of this in Jest in VSCode while debugging with Node 12.4.0. When running jest and babel, and placing breakpoints in static classes, the second you place them in the static class, in a static method, node throws this error. To fix, dont write weird static classes.

Resources