[英]Can not run 'npm start' ReactJS
I'm new in ReactJS nad Yeoman generator. 我是ReactJS nad Yeoman生成器中的新手。 Soo I have a problem, becasue when I generate project with this command
我有一个问题,因为使用此命令生成项目时
Then I set up project name, use css, and enable postcss. 然后设置项目名称,使用CSS并启用postcss。 When I try to use commend npm start # or npm run serve
当我尝试使用推荐的npm start#或npm run serve时
npm run serve npm运行发球
@0.0.1 serve C:\\Users\\user\\Desktop\\ProjectReact node server.js --env=dev
@ 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
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. 您用于运行server.js文件中的节点应用程序的端口是8000,该端口已被占用,并且正在其上运行其他进程。
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. 您可以在8000端口上终止当前正在运行的进程,也可以将
server.js
文件中的端口更改为8000端口以外的端口。 and try running again. 然后尝试再次运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.