关于node.js:无法运行\\’npm start \\’ReactJS

Can not run 'npm start' ReactJS

我是ReactJS nad Yeoman生成器中的新手。如此我有一个问题,因为使用此命令生成项目时

  • npm install -g yo
  • npm install -g generator-react-webpack
  • yo react-webpack
  • 然后我设置项目名称,使用CSS,然后启用postcss。
    当我尝试使用表扬
    npm start#或npm run serve

  • npm运行发球

    @0.0.1 serve C:\\Users\\user\\Desktop\\ProjectReact
    node server.js --env=dev

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    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\
    oaming\
    pm-cache\\_logs\\2018-05-25T07_27_23_660Z-debug.log

  • 用于运行server.js文件中的节点应用程序的端口是8000,该端口已被占用,并且正在其上运行其他进程。

    您可以在8000端口上终止当前正在运行的进程,也可以将server.js文件中的端口更改为8000端口以外的端口。然后尝试再次运行。