ENOENT webpack-dev-server esm - node.js

I inherited a react project hosted on azure-devops.
Cloned local repository
Need to downgrade npm and node versions to:
npm#6.14.8
node#v14.14.0
After that successfully install modules (npm i)
but now I can not run npm start and it's getting me this error.
npm start
> #0.1.0 start
> node -r esm scripts/run-webpack.js webpack-dev-server
spawn called
[Arguments] {
'0': '\\node_modules\\.bin\\webpack-dev-server',
'1': [ '-r', 'esm', '--mode=development', '--color' ],
'2': {
env: { NODE_ENV: 'development' },
windowsHide: true,
stdio: 'inherit'
}
}
Error: spawn \node_modules\.bin\webpack-dev-server ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:62:3)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:62:3)
at \Frontend\node_modules\esm\esm.js:1:34535
at \Frontend\node_modules\esm\esm.js:1:34176
at process.<anonymous> (\node_modules\esm\esm.js:1:34506)
at Function.<anonymous> (\node_modules\esm\esm.js:1:296856)
at Function.<anonymous> (\node_modules\esm\esm.js:1:296555)
at Function.<anonymous> (\node_modules\esm\esm.js:1:284879) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn \\node_modules\\.bin\\webpack-dev-server',
path: '\\node_modules\\.bin\\webpack-dev-server',
spawnargs: [ '-r', 'esm', '--mode=development', '--color' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #0.1.0 start: `node -r esm scripts/run-webpack.js webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #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! \AppData\Roaming\npm-cache\_logs\2022-03-16T09_23_36_828Z-debug.log
Log here:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '\\nodejs\\node.exe',
1 verbose cli '\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.8
3 info using node#v14.14.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle #0.1.0~prestart: #0.1.0
6 info lifecycle #0.1.0~start: #0.1.0
7 verbose lifecycle #0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle #0.1.0~start: PATH: \nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;\node_modules\.bin;\Python39\Scripts\;\Python39\;\Java\jre1.8.0_281\bin; (x86)\Common Files\Oracle\Java\javapath;\Ruby23-x64\bin;\Ruby23-x64\bin;\Windows\system32;\Windows;\Windows\System32\Wbem;\Windows\System32\WindowsPowerShell\v1.0\;\Windows\System32\OpenSSH\; (x86)\NVIDIA Corporation\PhysX\Common;\NVIDIA Corporation\NVIDIA NvDLISR;\Microsoft SQL Server\130\Tools\Binn\;\TortoiseSVN\bin;\Git\cmd; (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\; (x86)\Microsoft SQL Server\140\Tools\Binn\; (x86)\Microsoft SQL Server\140\DTS\Binn\; (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;\devkit\mingw\bin; (x86)\Microsoft SQL Server\150\DTS\Binn\;\jruby-9.1.17.0\bin;\ProgramData\chocolatey\bin;\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;\WINDOWS\system32;\WINDOWS;\WINDOWS\System32\Wbem;\WINDOWS\System32\WindowsPowerShell\v1.0\;\WINDOWS\System32\OpenSSH\;\TortoiseGit\bin; (x86)\Microsoft SQL Server\150\Tools\Binn\;\Microsoft SQL Server\150\Tools\Binn\;\Microsoft SQL Server\150\DTS\Binn\;\WINDOWS\system32;\WINDOWS;\WINDOWS\System32\Wbem;\WINDOWS\System32\WindowsPowerShell\v1.0\;\WINDOWS\System32\OpenSSH\;\dotnet\;\Azure Data Studio\bin;\Docker\Docker\resources\bin;\ProgramData\DockerDesktop\version-bin;\nodejs\;\jruby-9.1.17.0\bin;\Ruby23-x64\bin;\AppData\Local\Microsoft\WindowsApps;\.dotnet\tools;\AppData\Local\Programs\Microsoft VS Code\bin;;\Azure Data Studio\bin;\AppData\Roaming\npm
9 verbose lifecycle #0.1.0~start: CWD:
10 silly lifecycle #0.1.0~start: Args: [ '/d /s /c', 'node -r esm scripts/run-webpack.js webpack-dev-server' ]
11 silly lifecycle #0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle #0.1.0~start: Failed to exec start script
13 verbose stack Error: #0.1.0 start: `node -r esm scripts/run-webpack.js webpack-dev-server`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid #0.1.0
15 verbose cwd
16 verbose Windows_NT 10.0.22000
17 verbose argv "\\nodejs\\node.exe" "\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v14.14.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error #0.1.0 start: `node -r esm scripts/run-webpack.js webpack-dev-server`
22 error Exit status 1
23 error Failed at the #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 ]
I have tried everything in my power but nothing worked and now I am desperate, please help!

ENOENT webpack-dev-server esm
According to the error message, it seems this issue related to the webpack-dev-server.
So, please try to access the command webpack-dev-server, you could try to set a command in npm's package.json file like
"scripts": {
"start": "webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors"
}
Or you could try to install the script in global scope as well before you run the npm start:
sudo npm install -g webpack-dev-server

Related

NixOs: Can’t setup development with electron: Error: spawn ENOENT

I need to create a project involving electron and some libraries (easymidi), but I can't find how to do:
If I install electron from Nix directly, for instance using nix-shell -p electron_17, I can start a basic hello world project, but then I can't import other node libraries (if I install them with yarn, I get an error about unknown symbols, I guess because yarn and the nix electron runs different nodejs version
If I do everything using yarn or npm, electron can't even start a basic hello world folder:
$ nix-shell -p yarn
$ git clone https://github.com/electron/electron-quick-start
$ cd electron-quick-start/
$ yarn install
$ yarn start
yarn run v1.22.15
$ electron .
events.js:377
throw er; // Unhandled 'error' event
^
Error: spawn /tmp/c/electron-quick-start/node_modules/electron/dist/electron ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /tmp/c/electron-quick-start/node_modules/electron/dist/electron',
path: '/tmp/c/electron-quick-start/node_modules/electron/dist/electron',
spawnargs: [ '.' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Any idea what I did wrong? How can I setup electron with some random libraries like easymidi?
EDIT
Here is the log file (tried the same with npm, same error):
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/bin/node',
1 verbose cli '/nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/bin/npm',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.15
3 info using node#v14.18.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle electron-quick-start#1.0.0~prestart: electron-quick-start#1.0.0
6 info lifecycle electron-quick-start#1.0.0~start: electron-quick-start#1.0.0
7 verbose lifecycle electron-quick-start#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle electron-quick-start#1.0.0~start: PATH: /nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/tmp/d/electron-quick-start/no
de_modules/.bin:/nix/store/yx24h6ywbkg7rm5x7lrm8mx8ypcf4ywi-bash-interactive-5.1-p8/bin:/nix/store/fj3ywsx22xvjd4mly4323ikjcavyv91v-patchelf-0.13/bin:/nix/store/s5hkav7whndbfz0szshpb46h4idqdq9a-gcc-wrapper-10.3
.0/bin:/nix/store/a2w3l1m75908yd05a0h40vnrzvxfd0gd-gcc-10.3.0/bin:/nix/store/mfz26azl9561jgd5n73nkszzp6qhsaal-glibc-2.33-50-bin/bin:/nix/store/xyn0240zrpprnspg3n0fi8c8aw5bq0mr-coreutils-8.32/bin:/nix/store/5d5j
1z9bg01wqxahihy2x5n22ykc32w8-binutils-wrapper-2.35.1/bin:/nix/store/a4mmjm3bblxwp8h53bcfx3dly80ib0ba-binutils-2.35.1/bin:/nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/bin:/nix/store/xyn0240zrpprnsp
g3n0fi8c8aw5bq0mr-coreutils-8.32/bin:/nix/store/1nq62klcc9n2jv2ixaf77makkzdcghrh-findutils-4.8.0/bin:/nix/store/xwkxkx4bk005q35hsdhqbkbdv7g28cz5-diffutils-3.8/bin:/nix/store/dy4ylp9439la4lq35ah2mj80fi87pk4w-gnu
sed-4.8/bin:/nix/store/xxgddhdi57bbgd1yxza44plq6krjmiz1-gnugrep-3.6/bin:/nix/store/31pkw5yi08fj4l0glzvpf1cp4ywkxh86-gawk-5.1.0/bin:/nix/store/nwg8in201f7y6vdm787v3j84jjrn0ayw-gnutar-1.34/bin:/nix/store/ygzg6wzh
gxf51ianb4zjvrzq4ilx9jd7-gzip-1.10/bin:/nix/store/gakfgapj20lv13vkcz6c38j8i9vz4ypi-bzip2-1.0.6.0.2-bin/bin:/nix/store/xgp0bgw4rpnbc3vr2qdsdbixp3zy4v1l-gnumake-4.3/bin:/nix/store/wadmyilr414n7bimxysbny876i2vlm5r
-bash-5.1-p8/bin:/nix/store/347zp4r9a7gm5gk0gwijqw294nnyypcs-patch-2.7.6/bin:/nix/store/f2x98vk07px8916b9xid7jq6ky86sfmi-xz-5.2.5-bin/bin
9 verbose lifecycle electron-quick-start#1.0.0~start: CWD: /tmp/d/electron-quick-start
10 silly lifecycle electron-quick-start#1.0.0~start: Args: [ '-c', 'electron .' ]
11 silly lifecycle electron-quick-start#1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle electron-quick-start#1.0.0~start: Failed to exec start script
13 verbose stack Error: electron-quick-start#1.0.0 start: `electron .`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (/nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1058:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
14 verbose pkgid electron-quick-start#1.0.0
15 verbose cwd /tmp/d/electron-quick-start
16 verbose Linux 5.10.75
17 verbose argv "/nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/bin/node" "/nix/store/06680csx89n416lvsy2yljmw6rvibj8y-nodejs-14.18.0/bin/npm" "start"
18 verbose node v14.18.0
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error electron-quick-start#1.0.0 start: `electron .`
22 error Exit status 1
23 error Failed at the electron-quick-start#1.0.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 ]
EDIT
I also tried npm2nix-like tools, but they also failed.

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

After "npx create-react-app" "npm start" fails with following error: TypeError: Cannot read property 'split' of undefined

Node v12.18.4
Npm 6.14.11
react-scripts 4.0.1
Hello, this is not my first react-app but I am getting an error that makes no sense.
After using "npx create-react-app" cd into my app and "npm start" I am getting this error
/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/react-scripts/scripts/start.js:19
throw err;
^
TypeError: Cannot read property 'split' of undefined
at processModule (/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/eslint-webpack-plugin/dist/index.js:93:38)
at SyncHook.eval [as call] (eval at create (/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:5:1)
at SyncHook.lazyCompileHook (/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/tapable/lib/Hook.js:154:20)
at /Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/webpack/lib/Compilation.js:781:30
at MultiModule.build (/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/webpack/lib/MultiModule.js:39:10)
at Compilation.buildModule (/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/webpack/lib/Compilation.js:739:10)
at /Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/webpack/lib/Compilation.js:1111:12
at MultiModuleFactory.create (/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/webpack/lib/MultiModuleFactory.js:18:3)
at /Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/webpack/lib/Compilation.js:1063:18
at Semaphore.acquire (/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/webpack/lib/util/Semaphore.js:29:4)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! todo-app#0.1.0 start: `./node_modules/react-scripts/bin/react-scripts.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the todo-app#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! /Users/pablodeyzaguirre/.npm/_logs/2021-01-19T13_21_16_205Z-debug.log
MBP-de-Pablo:todo-app pablodeyzaguirre$
I have deleted node_modules and installed again, installed react-scripts globally, updated npm & react version.
The full log of the error is:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#6.14.11
3 info using node#v12.18.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle todo-app#0.1.0~prestart: todo-app#0.1.0
6 info lifecycle todo-app#0.1.0~start: todo-app#0.1.0
7 verbose lifecycle todo-app#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle todo-app#0.1.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app/node_modules/.bin:/Users/pablodeyzaguirre/.symfony/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Users/pablodeyzaguirre/.symfony/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/pablodeyzaguirre/Library/Android/sdk/emulator:/Users/pablodeyzaguirre/Library/Android/sdk/tools:/Users/pablodeyzaguirre/Library/Android/sdk/tools/bin:/Users/pablodeyzaguirre/Library/Android/sdk/platform-tools:/Users/pablodeyzaguirre/Library/Android/sdk/emulator:/Users/pablodeyzaguirre/Library/Android/sdk/tools:/Users/pablodeyzaguirre/Library/Android/sdk/tools/bin:/Users/pablodeyzaguirre/Library/Android/sdk/platform-tools
9 verbose lifecycle todo-app#0.1.0~start: CWD: /Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app
10 silly lifecycle todo-app#0.1.0~start: Args: [ '-c', './node_modules/react-scripts/bin/react-scripts.js start' ]
11 silly lifecycle todo-app#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle todo-app#0.1.0~start: Failed to exec start script
13 verbose stack Error: todo-app#0.1.0 start: `./node_modules/react-scripts/bin/react-scripts.js start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid todo-app#0.1.0
15 verbose cwd /Users/pablodeyzaguirre/Documents/Personal/TechnicalTests/informa/todo-app
16 verbose Darwin 20.2.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v12.18.4
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error todo-app#0.1.0 start: `./node_modules/react-scripts/bin/react-scripts.js start`
22 error Exit status 1
23 error Failed at the todo-app#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 ]
If someone has encountered this problem before pls help, I have been looking around in google and stackoverflow with no luck
Encountered basically the same issue as you. For us it ended up being special quotes in our env variables. Once we removed those, it all worked ... 🤯
Took a work day to figure this one out!

Unable to run npm start in create-react-app

PROBLEM
Need to run my react project
I have install create-react-app and create a project, When I tried to run project using npm start its showing some error
When I first tried in my home dir everythings work fine, Problem only when I tried to create and run in specfic dir
USING
Kubuntu OS,
Nodejs : V10.15.3
npm : 6.9.0
By little bit of google I done following thing
Remove nodemodule and install
Clear npm cache and one again try it as fresh
Uninstall and install both node and npm
Access the project as root
When I try to : npm ls react
kasi#kasi:~/my/node_modules$ npm ls react
my#0.1.0 /home/kasi/my
`-- react#16.8.6
No other things
Some Google - Check point:
kasi#kasi:~/my/node_modules$ which node
/home/kasi/.nvm/versions/node/v10.15.3/bin/node
kasi#kasi:~/my/node_modules$ which npm
/usr/bin/npm
kasi#kasi:~/my/node_modules$ cd ../../../../usr/local/bin/
kasi#kasi:/usr/local/bin$ ls
create-react-app n node npx tsc tsserver
TIP:
All my disk are FAT type so some problem may be on symlink
When I try to start direct as follow
kasi#kasi:/media/kasi/others/reaact/myapp$ node node_modules/react-scripts/scripts/start.js
It show
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn /media/kasi/others/reaact/myapp/node_modules/opn/xdg-open EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
I will attach log file created
0 info it worked if it ends with ok
1 verbose cli [ '/home/kasi/.nvm/versions/node/v10.15.3/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'start' ]
2 info using npm#6.9.0
3 info using node#v10.15.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle myapp#0.1.0~prestart: myapp#0.1.0
6 info lifecycle myapp#0.1.0~start: myapp#0.1.0
7 verbose lifecycle myapp#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle myapp#0.1.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/media/kasi/others/reaact/myapp/node_modules/.bin:/home/kasi/.nvm/versions/node/v10.15.3/bin:/home/kasi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle myapp#0.1.0~start: CWD: /media/kasi/others/reaact/myapp
10 silly lifecycle myapp#0.1.0~start: Args: [ '-c', 'react-scripts start' ]
11 info lifecycle myapp#0.1.0~start: Failed to exec start script
12 verbose stack Error: myapp#0.1.0 start: `react-scripts start`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:189:13)
12 verbose stack at maybeClose (internal/child_process.js:970:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
13 verbose pkgid myapp#0.1.0
14 verbose cwd /media/kasi/others/reaact/myapp
15 verbose Linux 4.18.0-18-generic
16 verbose argv "/home/kasi/.nvm/versions/node/v10.15.3/bin/node" "/usr/bin/npm" "start"
17 verbose node v10.15.3
18 verbose npm v6.9.0
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error myapp#0.1.0 start: `react-scripts start`
23 error spawn ENOENT
24 error Failed at the myapp#0.1.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 ]

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

Resources