Array-Huang / webpack-seed

这是一个基于webpack的多页应用脚手架
https://segmentfault.com/a/1190000006843916
MIT License
1.19k stars 283 forks source link

我是操作步骤一步一步来的,但是现在还是不能发现报错了 #11

Closed Create-Peace closed 7 years ago

Create-Peace commented 7 years ago

webpack-dev-server --inline --progress --compress --devtool eval --content-base build/

70% 5/5 build modulesevents.js:141 throw er; // Unhandled 'error' event ^

Error: listen EACCES 127.0.0.1:8080 at Object.exports._errnoException (util.js:907:11) at exports._exceptionWithHostPort (util.js:930:20) at Server._listen2 (net.js:1237:19) at listen (net.js:1286:10) at net.js:1395:9 at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:64:16) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:83:10)

npm ERR! Windows_NT 10.0.10586 npm ERR! argv "E:\Program Files\nodejs\node.exe" "E:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "start" npm ERR! node v4.5.0 npm ERR! npm v2.15.9 npm ERR! code ELIFECYCLE npm ERR! webpack-seed@1.2.2 start: webpack-dev-server --inline --progress --compress --devtool eval --content-base build/ npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the webpack-seed@1.2.2 start script 'webpack-dev-server --inline --progress --compress --devtool eval --content-base build/'. npm ERR! This is most likely a problem with the webpack-seed package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack-dev-server --inline --progress --compress --devtool eval --content-base build/ npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs webpack-seed npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls webpack-seed npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! E:\apache-tomcat-7.0.26\webpackStudy\webpack-seed-master\npm-debug.log

Array-Huang commented 7 years ago

嗯,我自己刚刚download了一个zip试了一下,还是没有报错呢。

$ npm install --global webpack webpack-dev-server
Array-Huang commented 7 years ago

错误是Error: listen EACCES 127.0.0.1:8080 google了一下,貌似是监听端口报的错,你用的是不是Linux?

Create-Peace commented 7 years ago

我使用的是widows,但是现在npm run build也是没有问题的。

Create-Peace commented 7 years ago

webpack-seed@1.2.2 build E:\apache-tomcat-7.0.26\webpackStudy\webpack-seed-master node npm-scripts/before-build.script.js && webpack --progress --colors --bail

build目录已清空 Hash: c6da4d3c682549697a0e Version: webpack 1.13.3 Time: 14199ms Asset Size Chunks Chunk Names index/index/entry.js 824 bytes 1 [emitted] index/index index.html 165 bytes [emitted] static/js/html5shiv.min.js 2.73 kB [emitted] static/js/respond.min.js 4.38 kB [emitted] static/images/login-bg.jpg 679 kB [emitted] dll/dll.js 381 kB [emitted] dll/dll.css 107 kB [emitted] static/fonts/iconfont.eot 6.84 kB [emitted] static/fonts/iconfont.woff 4.29 kB [emitted] static/fonts/iconfont.ttf 6.56 kB [emitted] static/fonts/iconfont.svg 5.29 kB [emitted] alert/index/entry.js 101 bytes 0 [emitted] alert/index static/js/xdomain.all.js 44.5 kB [emitted] index/login/entry.js 328 bytes 2 [emitted] index/login user/edit-password/entry.js 101 bytes 3 [emitted] user/edit-password user/modify-info/entry.js 101 bytes 4 [emitted] user/modify-info commons/commons/bundle.js 1.64 kB 5 [emitted] commons/commons index/login/styles.css 424 bytes 2 [emitted] index/login commons/commons/styles.css 5.46 kB 5 [emitted] commons/commons alert/index/page.html 5.99 kB [emitted] index/index/page.html 3.68 kB [emitted] index/login/page.html 7.41 kB [emitted] user/edit-password/page.html 7.8 kB [emitted] user/modify-info/page.html 4.34 kB [emitted]

Array-Huang commented 7 years ago

嗯,那应该是webpack-dev-server的锅,你试下随便找个目录进去用下webpack-dev-server看会不会报错?

$ webpack-dev-server
Create-Peace commented 7 years ago

十分感谢你的耐心解答,我找到原因了,是我电脑的8080端口被占用了,启动不正常了。能加个好友吗?QQ或者微信?