Nodejs exception error: listen eacces 127.0.0.1:8000

This article is reprinted, if you do not want to infringe copyright, please timely inform
The original address to http://blog.csdn.net/y2010081134/article/details/72800812
Exception information

Error: listen EACCES 127.0.0.1:8000
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at Server._listen2 (net.js:1245:19)
    at listen (net.js:1294:10)
    at net.js:1404:9
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `http-server ./app -a localhost -p 8000 -c-1`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'http-server ./app -a localhost -p 8000 -c-1'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     http-server ./app -a localhost -p 8000 -c-1
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular-phonecat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\Git\Repository\angular-phonecat\npm-debug.log

The solution


The exception is caused by 8000 port being occupied. Check the 8000 port being occupied under Windows

E:\Git\Repository\angular-phonecat>netstat -ano|findstr "8000"
  TCP    0.0.0.0:8000           0.0.0.0:0              LISTENING       18480
  TCP    127.0.0.1:8000         127.0.0.1:50236        TIME_WAIT       0
  TCP    127.0.0.1:8000         127.0.0.1:50237        TIME_WAIT       0
  TCP    127.0.0.1:8000         127.0.0.1:50238        TIME_WAIT       0
  TCP    127.0.0.1:8000         127.0.0.1:50239        TIME_WAIT       0
  TCP    127.0.0.1:8000         127.0.0.1:50240        TIME_WAIT       0
  TCP    127.0.0.1:8000         127.0.0.1:50286        TIME_WAIT       0
  TCP    127.0.0.1:50285        127.0.0.1:8000         TIME_WAIT       0
  UDP    0.0.0.0:8000           *:*                                    18480

Because process 0 is a system process, executing “Taskkill/PID 0” will not kill it. So, find another way to change the port, as follows:

Under node’s installation root, find package.json, search 8000, and replace with 8888


 

Then execute the command NPM Start from the command line, and it starts successfully

Enter it in the browser
http://localhost:8888
, you can see the successful access

Read More: