2015-04-16 35 views
4

我有以下錯誤,而我試圖命令:的WebPack-dev的服務器:NPM錯誤Windows_NT 7601

$ npm run dev 

我也用CMD的NodeJS,Git和還分別具有與CMD administritive特權。

錯誤就像是以下幾點:

D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\webpack-examp 
le-master>npm run dev 

> [email protected] dev D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\webpack-example-master 
> webpack-dev-server --devtool eval --progress --colors --hot --content-base build/ 

70% 1/1 build modulesevents.js:85 
throw er; // Unhandled 'error' event 
     ^
Error: listen EACCES 
at exports._errnoException (util.js:746:11) 
at Server._listen2 (net.js:1129:19) 
at listen (net.js:1172:10) 
at net.js:1270:9 
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:81:16) 
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:99:10) 

npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "node" "C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\\npm\\b 
in\\npm-cli.js" "run" "dev" 
npm ERR! node v0.12.2 
npm ERR! npm v2.7.6 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] dev: `webpack-dev-server --devtool eval --progress --colors --hot --content-base build/` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] dev script 'webpack-dev-server--devtool eval --progress --colors --hot --content-base build/'. 
npm ERR! This is most likely a problem with the webpack-example package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  webpack-dev-server --devtool eval --progress --colors --hot --content-base build/ 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls webpack-example 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\ 
webpack-example-master\npm-debug.log 

D:\IIT Samester\KAZ\ReactJSProjects\GitFrom\webpack-example-master\webpack-example-master> 

請你幫助解決問題。

+0

錯誤說,這是一個錯誤的WebPack(而不是'npm')。你有沒有試圖簡化你的代碼,看看是什麼導致了錯誤? – WiredPrairie

+0

frpm github收集的源代碼可以在另一臺電腦上使用。但在我的筆記本電腦中,我得到了錯誤。不明白問題。 –

回答

7

是的,我已經自我解決的問題。

它的端口上的問題,沒有別的。

我還有其他的程序,在端口8080工作。

webpack-dev-server也希望默認使用該端口。

所以我剛剛從8080更改端口號到8081(可以是任何有效的除外)在ProjectFolder \ node_modules \的WebPack-DEV-服務器\ BIN \的WebPack-DEV-server.js文件。

Anothe解決方案是,你可以停止該程序在端口8080的工作

謝謝:)

+0

你應該接受你自己的答案,因爲,你知道,回答 –

+0

當我面臨的問題,解決辦法是未知的,在計算器中寫道獲取幫助。解決問題後,我只是將它發佈給其他人。 –

+1

我明白並且非常感謝你,如果解決了問題,最好接受你自己的答案 –