簡體   English   中英

無法運行'npm start'ReactJS

[英]Can not run 'npm start' ReactJS

我是ReactJS nad Yeoman生成器中的新手。 我有一個問題,因為使用此命令生成項目時

  1. npm install -g yo
  2. npm install -g generator-react-webpack
  3. yo react-webpack

然后設置項目名稱,使用CSS並啟用postcss。 當我嘗試使用推薦的npm start#或npm run serve時

  1. npm運行發球

    @ 0.0.1服務C:\\ Users \\ user \\ Desktop \\ ProjectReact節點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 

您用於運行server.js文件中的節點應用程序的端口是8000,該端口已被占用,並且正在其上運行其他進程。

您可以在8000端口上終止當前正在運行的進程,也可以將server.js文件中的端口更改為8000端口以外的端口。 然后嘗試再次運行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM