npm start givin error - node.js

I am building a project with react (Downloaded project using git) and have recently encountered the following error when running
npm start
The error is
enter code here
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#5.4.2
3 info using node#v8.7.0
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: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/ambuj/Documents/react-weather-app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin
9 verbose lifecycle #~start: CWD: /home/ambuj/Documents/react-weather-app
10 silly lifecycle #~start: Args: [ '-c', 'concurrently "yarn serve:webpack" "yarn serve:json"' ]
11 silly lifecycle #~start: Returned: code: 1 signal: null
12 info lifecycle #~start: Failed to exec start script
13 verbose stack Error: # start: `concurrently "yarn serve:webpack" "yarn serve:json"`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280: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> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55: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:927:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid #
15 verbose cwd /home/ambuj/Documents/react-weather-app
16 verbose Linux 4.10.0-19-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v8.7.0
19 verbose npm v5.4.2
20 error code ELIFECYCLE
21 error errno 1
22 error # start: `concurrently "yarn serve:webpack" "yarn serve:json"`
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 ]

First install all the dependencies using npm install and then run npm start.

Try to remove the folder node_modules and reinstall them with npm install

Related

error when running npm run dev on laravel + inertia + linux

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node',
'/usr/bin/npm', 'run', 'dev' ] 2 info using npm#6.14.4 3 info using
node#v10.19.0 4 verbose run-script [ 'predev', 'dev', 'postdev' ] 5
info lifecycle #~predev: # 6 info lifecycle #~dev: # 7 verbose
lifecycle #~dev: unsafe-perm in lifecycle true 8 verbose lifecycle
#~dev: PATH:
/usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/html/SostLaravel/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/mssql-tools18/bin
9 verbose lifecycle #~dev: CWD: /var/www/html/SostLaravel 10 silly
lifecycle #~dev: Args: [ '-c', 'npm run development' ] 11 silly
lifecycle #~dev: Returned: code: 1 signal: null 12 info lifecycle
#~dev: Failed to exec dev script 13 verbose stack Error: # dev: npm run development 13 verbose stack Exit status 1 13 verbose stack
at EventEmitter.
(/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16) 13 verbose
stack at EventEmitter.emit (events.js:198:13) 13 verbose stack
at ChildProcess.
(/usr/share/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 # 15 verbose cwd
/var/www/html/SostLaravel 16 verbose Linux 5.4.0-135-generic 17
verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev" 18 verbose
node v10.19.0 19 verbose npm v6.14.4 20 error code ELIFECYCLE 21
error errno 1 22 error # dev: npm run development 22 error Exit
status 1 23 error Failed at the # dev script. 23 error This is
probably not a problem with npm. There is likely additional logging
output above. 24 verbose exit [ 1, true ]
Good morning, I've already cleared the cache, I've reinstalled npm, I've deleted node-modules and package-lock, I've done everything but everything results in this same error.
Might be a good idea to check your node version and be sure its compatible with your packages.

How do I solve an nexe compilation code 2 error?

I am trying to compile my node server using nexe (3.3.2) but it keeps failing. When I first tried, it said I needed to use the --build flag which I included in my script. The process kicked off again, compiled for over two hours and then failed.
I upgraded my node and npm versions using Homebrew, it didn't work. I thought it might be the size of the folders I've included but even if I just include my server.js, it fails.
Does anyone have any ideas for me please? Below is a copy of the latest log file.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/lib/node_modules/node/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v13.8.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle robson-callcentre#0.1.0~prebuild: robson-callcentre#0.1.0
6 info lifecycle robson-callcentre#0.1.0~build: robson-callcentre#0.1.0
7 verbose lifecycle robson-callcentre#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle robson-callcentre#0.1.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server/node_modules/.bin:/usr/local/opt/openssl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
9 verbose lifecycle robson-callcentre#0.1.0~build: CWD: /Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server
10 silly lifecycle robson-callcentre#0.1.0~build: Args: [ '-c', 'nexe server.js --build' ]
11 silly lifecycle robson-callcentre#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle robson-callcentre#0.1.0~build: Failed to exec build script
13 verbose stack Error: robson-callcentre#0.1.0 build: `nexe server.js --build`
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:321: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:321:20)
13 verbose stack at maybeClose (internal/child_process.js:1026:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid robson-callcentre#0.1.0
15 verbose cwd /Users/darryllrobinson/Documents/projects/Source/fonebookeohcollections/server
16 verbose Darwin 19.4.0
17 verbose argv "/usr/local/lib/node_modules/node/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v13.8.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error robson-callcentre#0.1.0 build: `nexe server.js --build`
22 error Exit status 1
23 error Failed at the robson-callcentre#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I wasn't able to resolve the problem so I used pkg instead.

Node error (webpack-cli) when running npm dev. Can't figure out what the error message means

I'm new to node.
I'm using the Node Express Vue Mongo stack on Windows.
Yesterday my program worked just fine running without any errors, but today when I tried to run NPM dev it crashed.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '\\Program Files\\nodejs\\node.exe',
1 verbose cli '\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v13.13.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle client#1.0.0~predev: client#1.0.0
6 info lifecycle client#1.0.0~dev: client#1.0.0
7 verbose lifecycle client#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle client#1.0.0~dev: DELETED(privacy)
9 verbose lifecycle client#1.0.0~dev: CWD: \Documents\Projecten\soundboard_school\client
10 silly lifecycle client#1.0.0~dev: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'webpack-dev-server --inline --progress --config build/webpack.dev.conf.js'
10 silly lifecycle ]
11 silly lifecycle client#1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle client#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: client#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> (\AppData\Roaming\npm\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> (\AppData\Roaming\npm\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:1026:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid client#1.0.0
15 verbose cwd \Documents\Projecten\soundboard_school\client
16 verbose Windows_NT 10.0.18362
17 verbose argv "\\Program Files\\nodejs\\node.exe" "\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v13.13.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error client#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 client#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 ]
This is the error message I got, but I can't figure out for the love of me what it means. Googling doesnt give me any answers.
Does anyone have any idea what I could do to fix?
I have tried to clear my cache, delete node_modules and package-lock and use npm-install again multiple times to no avail.

Vue.js project after updating webpack-dev-server to 3.2.1 - throws an error

It will throw the error when update to version 3.2.1. Before 2.9.7 no this error.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run-script',
1 verbose cli 'dev' ]
2 info using npm#6.8.0
3 info using node#v10.13.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle mcute#1.0.0~predev: mcute#1.0.0
6 info lifecycle mcute#1.0.0~dev: mcute#1.0.0
7 verbose lifecycle mcute#1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle mcute#1.0.0~dev: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/turtuvshin/Projects/mcute/frontend/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/turtuvshin/Projects/mcute/node_modules/.bin:/usr/local/mongodb/bin:/anaconda3/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/mongodb/bin:/anaconda3/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin
9 verbose lifecycle mcute#1.0.0~dev: CWD: /Users/turtuvshin/Projects/mcute/frontend
10 silly lifecycle mcute#1.0.0~dev: Args: [ '-c',
10 silly lifecycle 'webpack-dev-server --inline --progress --config build/webpack.dev.conf.js' ]
11 silly lifecycle mcute#1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle mcute#1.0.0~dev: Failed to exec dev script
13 verbose stack Error: mcute#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> (/usr/local/lib/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> (/usr/local/lib/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 mcute#1.0.0
15 verbose cwd /Users/turtuvshin/Projects/mcute/frontend
16 verbose Darwin 18.2.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run-script" "dev"
18 verbose node v10.13.0
19 verbose npm v6.8.0
20 error code ELIFECYCLE
21 error errno 1
22 error mcute#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 mcute#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 ]
There are various issues regarding this error.
There is known bug with upgrading webpack-dev-server from version 2.9.7.
Quickest solution would be to downgrade it to v2.9.7
npm install webpack-dev-server#2.9.7 --save-dev
Also, check the vuejs version in your project, and webpack version too, since they must be compatible with proper version of wepack-dev-server too.

Build nodejs Fail with exit status 126 - Permission denied

I faced a issue when I do a npm start in my linux server.
It is showing error with exit code 126 and permission denied.
I have already done chmod 777 to server.js or rather to the whole folder of demoTest.
How do I fixed this?
The log is shown as below.
info it worked if it ends with ok
1 verbose cli [ '/opt/node-v8.11.3-linux-x64/bin/node', '/bin/npm', 'start' ]
2 info using npm#5.6.0
3 info using node#v8.11.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle demoTest#1.0.0~prestart: demoTest#1.0.0
6 info lifecycle demoTest#1.0.0~start: demoTest#1.0.0
7 verbose lifecycle demoTest#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle demoTest#1.0.0~start: PATH: /opt/node-v8.11.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/useradmin/demoTest/node_modules/.bin:/sbin:/bin:/usr/sbin:/usr/bin
9 verbose lifecycle demoTest#1.0.0~start: CWD: /home/useradmin/demoTest
10 silly lifecycle demoTest#1.0.0~start: Args: [ '-c', 'nodemon ./rest/server.js' ]
11 silly lifecycle demoTest#1.0.0~start: Returned: code: 126 signal: null
12 info lifecycle demoTest#1.0.0~start: Failed to exec start script
13 verbose stack Error: demoTest#1.0.0 start: `nodemon ./rest/server.js`
13 verbose stack Exit status 126
13 verbose stack at EventEmitter.<anonymous> (/opt/node-v8.11.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/opt/node-v8.11.3-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid demoTest#1.0.0
15 verbose cwd /home/useradmin/demoTest/rest
16 verbose Linux 3.10.0-862.el7.x86_64
17 verbose argv "/opt/node-v8.11.3-linux-x64/bin/node" "/bin/npm" "start"
18 verbose node v8.11.3
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 126
22 error demoTest#1.0.0 start: `nodemon ./rest/server.js`
22 error Exit status 126
23 error Failed at the demoTest#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 [ 126, true ]
I was getting this same issue when running a Nodejs server and Reactjs client. This process worked for me and should be done in the affected directory (I think that's demoTest for you):
Delete node_modules
Run npm install to reinstall the dependencies in that directory's package.json
I believe this problem started when I copied node_modules from my host to my Ubuntu server rather than running the installs directly from the server CLI.
I am using nodemon and intellij was complaining with "app/server.js: Permission denied, errno 126" until I added the following to my config in package.json.
"scripts": {
"start": "nodemon app/server.js"
}

Resources