npm start fail today with following error - node.js

when I test my code today at react, I fail to start the dev server, and the error shows as blow.
material#2.0.0 start /Users/linyujie/Files/Softprofiles/SourceCode/successmanagerreact
npm run serve:dev
> material#2.0.0 serve:dev /Users/linyujie/Files/Softprofiles/SourceCode/successmanagerreact
> webpack-dev-server --host 0.0.0.0 --port 3000 --open --env dev
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:3000
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at doListen (net.js:1501:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:678:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! material#2.0.0 serve:dev: `webpack-dev-server --host 0.0.0.0 --port 3000 --open --env dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the material#2.0.0 serve: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! /Users/linyujie/.npm/_logs/2018-06-25T04_55_36_232Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! material#2.0.0 start: `npm run serve:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the material#2.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! /Users/linyujie/.npm/_logs/2018-06-25T04_55_36_255Z-debug.log

The port 3000 is in use. Try to use netstat to find the PID of the process that is using the port. And stop/kill the process if you do not need it. This link might be handy for windows and this for mac to find the process listening on the port.

as the error said: Error: listen EADDRINUSE 0.0.0.0:3000, it means there is an application currently using the same IP & port: 0.0.0.0:3000. If you're not sure which application is using, maybe you can try closing all the command prompt and launch only your application.

Related

simple react works with npm start but not with nohup npm start &

I tested with a simple app generated by
npx create-react-app myfirstreact
It works fine with
npm start
but if I try to run it in the background with
nohup npm start &
I get
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: EBADF: bad file descriptor, read Emitted 'error' event at:
at lazyFs.read (internal/fs/streams.js:165:12)
at FSReqWrap.wrapper [as oncomplete] (fs.js:467:17) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myfirstreact#0.1.0 start:
react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the myfirstreact#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!
/home/jglickman/.npm/_logs/2020-10-06T04_43_39_480Z-debug.log
Try running it like this:
nohup node scripts/start.js
I think this post will help too.

How to fix cross-env issue when running "npm run dev" for vue-cli

When I run npm run dev, I can not get the local IP properly.
Error: listen EFAULT: bad address in system call argument 0.0.0.0:8081
I do.
1. delete the "cross-env" folder and the "cross-spawn" folder under the node_modules
2. run npm install
3. run npm run dev
4. the error ip changes as follows.
Error: listen EFAULT: bad address in system call argument 10.0.75.1:8081
the ip address is vEthernet for the docker.
PS E:\WorkSpace\my-project> npm run dev
> my-project#1.0.0 dev E:\WorkSpace\my-project
> cross-env NODE_ENV=development webpack-dev-server --open --hot
E:\WorkSpace\my-project\node_modules\webpack-dev-server\bin\webpack-dev-server.js:356
if (err) throw err;
^
Error: listen EFAULT: bad address in system call argument 10.0.75.1:8081
at Server.setupListenHandle [as _listen2] (net.js:1279:14)
at listenInCluster (net.js:1327:12)
at doListen (net.js:1460:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-project#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-project#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\LG\AppData\Roaming\npm-cache\_logs\2019-06-11T13_23_46_070Z-debug.lo
What if you try this:
yarn remove webpack-dev-server
yarn add webpack-dev-server#2.9.1 --dev
yarn run dev
or using npm instead yarn

babel-watch server.js fails when running npm run dev

Im currently working thru a tutorial, and have noticing that when running npm run dev, the babel-watch server.js continues to fails. I have uninstalled/reinstalled babel-cli babel-preset-env and babel-watch without success. The output of the error is
npm run dev
> back-end#1.0.0 dev /home/pietto/back-end
> babel-watch server.js
Watcher failure { Error: watch server.js ENOSPC
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance (/home/pietto/back-end/node_modules/chokidar /lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/pietto/back-end/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/pietto/back-end/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/pietto/back-end/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher.<anonymous> (/home/pietto/back-end/node_modules/chokidar /lib/nodefs-handler.js:473:21)
at FSReqWrap.oncomplete (fs.js:153:5)
errno: 'ENOSPC',
code: 'ENOSPC',
syscall: 'watch server.js',
filename: 'server.js' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! back-end#1.0.0 dev: `babel-watch server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the back-end#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! /home/pietto/.npm/_logs/2018-10-12T19_20_06_169Z-debug.log
After some review, it was determined that I had multiple babel.rc process running in the background. Once I killed those process, worked well

Can not run 'npm start' ReactJS

I'm new in ReactJS nad Yeoman generator. Soo I have a problem, becasue when I generate project with this command
npm install -g yo
npm install -g generator-react-webpack
yo react-webpack
Then I set up project name, use css, and enable postcss.
When I try to use commend
npm start # or npm run serve
npm run serve
#0.0.1 serve C:\Users\user\Desktop\ProjectReact
node server.js --env=dev
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EACCES 127.0.0.1:8000
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at Server.setupListenHandle [as _listen2] (net.js:1338:19)
at listenInCluster (net.js:1396:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1505:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #0.0.1 serve: `node server.js --env=dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #0.0.1 serve 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\2018-05-25T07_27_23_660Z-debug.log
The port you are using to run the node application in your server.js file is 8000 which is already taken and some other process is running on it.
You can either kill the current running process on 8000 port or change the port in your server.js file to something else than 8000 port. and try running again.

Error starting NPM .. Ghost Blog .. error npm start

********** Update *********
This had to do with me changing my ports to those of my ipaddress in config.js so I can test on mobile and table. Any idea how I can do this without changing the ports everytime I reboot the computer so that they are always set to my ipaddress for testing?
**********Original Question ****
I am getting a strange error when starting npm to run my ghost blog. It has happened before and I went back to a previous commit on github. It seems like everytime I get it working through a different method and then stop working and close terminal. Then when I restart its another issues?? Maybe github is causing it. Any help would be great. Tried everything I know how to do.
here is the error message:
cconti77#Charless-iMac ~/sites/_repos/elite-university (get-back-on-it●●●)$ npm start
ghost#0.5.0 start /Users/cconti77/Sites/_repos/elite-university
node index
Migrations: Up to date at version 003
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRNOTAVAIL
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1023:19)
at listen (net.js:1064:10)
at net.js:1146:9
at dns.js:72:18
at process._tickCallback (node.js:419:13)
at process._tickFromSpinner (node.js:394:15)
npm ERR! ghost#0.5.0 start: `node index`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the ghost#0.5.0 start script.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get their info via:
npm ERR! npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "start"
npm ERR! cwd /Users/cconti77/Sites/_repos/elite-university
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/cconti77/Sites/_repos/elite-university/npm-debug.log
npm ERR! not ok code 0
You are already using the Ghost port for something else.
Most probably ghost exited the wrong way, or you are using forever/pm2 and the process hasn't closed properly. try killing any 'forever/pm2' instances, then reboot your machine. Worked for me.
To understand what happens, I suggest you try the following to see which process uses the ghost port, then kill the process. http://www.cyberciti.biz/faq/what-process-has-open-linux-port/
And also, you're a bit off-topic, this should be moved to SuperUser.

Resources