2016-11-22 250 views
0

我試圖NPM運行開始NG2管理員,都被工作,直到我做了NPM更新嘗試更新pacakages,的WebPack-DEV-服務器錯誤啓動

後沒有NPM啓動和有一個錯誤:

webpack-dev-server --config config/webpack.dev.js --progress --profile --watch --content-base src/ 
10% building modules 3/3 modules 0 activeError: listen EADDRINUSE 127.0.0.1:8080 
at Object.exports._errnoException (util.js:1026:11) 
at exports._exceptionWithHostPort (util.js:1049:20) 
at Server._listen2 (net.js:1257:14) 
at listen (net.js:1293:10) 
at net.js:1403:9 
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16) 
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10) 
npm ERR! Darwin 15.5.0 
npm ERR! argv "/Users/vm/versions/node/v6.9.1/bin/node" node/v6.9.1/bin/npm" "run" "server:dev" 
npm ERR! node v6.9.1 
npm ERR! npm v3.10.8 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] server:dev: webpack-dev-server --config config/webpack.dev.js --progress --profile --watch --content-base src/ 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] server:dev script 'webpack-dev-server --config config/webpack.dev.js --progress --profile --watch --content-base src/'. 
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 ng2-admin package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR! webpack-dev-server --config config/webpack. 

回答

1

變化依賴於

「的WebPack-dev的服務器」: 「2.1.0-beta.10」, 而不是像

「的WebPack-dev的服務器」: 「^ 2.1.0-beta.9」,

之後運行npm install或npm更新。

+0

爲什麼這很重要? – 2017-07-28 17:33:55

1

錯誤消息的相關部分是:listen EADDRINUSE 127.0.0.1:8080。這意味着webpack-dev-server試圖在127.0.0.1:8080上運行,但地址和端口已被使用。

嘗試打開瀏覽器並在地址欄中輸入127.0.0.1:8080。也許有另一臺服務器已經在該端口上運行。運行jobs以檢查後臺進程。在的package.json

+0

nope,我嘗試重新啓動相同的問題,當我得到這個地址,然後我得到:Html Webpack插件: 錯誤:子編譯失敗: 模塊未找到:錯誤:無法解析'string-replace-loader ?/「用戶名/密碼」中的{「search」:「var sourceMappingUrl = extractSourceMappingUrl \\(cssText \\);」,「replace」:「var sourceMappingUrl = \」\「;」,「flags」:「我的應用程序/管理門戶網站': 錯誤:無法解析'string-replace-loader?{「search」:「var sourceMappingUrl = extractSourceMappingUrl \\(cssText \\);」,「replace 「:」var –

+0

@VitalyMenchikovsky只是要清楚,你從哪裏得到那個錯誤? – RyanZim

+0

我知道了,當我做npm開始也當我去這個地址時127.0.0.1:8080 –