如何解决 webpack-dev-server 的错误?
How to resolve error with webpack-dev-server?
当我尝试 运行 server: npm start 时,我经常会遇到奇怪的错误。所以,我不知道如何解决这个问题,因为没有任何关于 Node.js 错误的解释。谁能说说有什么问题吗?
其中一个是:
> angular-starter@6.0.0 webpack-dev-server D:\Projects\UI
> node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js "--config" "config/webpack.dev.js" "--open" "--progress" "--profile" "--watch" "--content-base" "src/"
10% building modules 2/2 modules 0 activeError: listen EADDRINUSE 127.0.0.1:3000
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at Server._listen2 (net.js:1258:14)
at listen (net.js:1294:10)
at net.js:1404:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-starter@6.0.0 webpack-dev-server: `node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js "--config" "config/webpack.dev.js" "--open" "--progress" "--profile" "--watch" "--content-base" "src/"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-starter@6.0.0 webpack-dev-server 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\Oleg\AppData\Roaming\npm-cache\_logs17-07-28T12_52_25_565Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-starter@6.0.0 server:dev: `npm run webpack-dev-server -- --config config/webpack.dev.js --open --progress --profile --watch --content-base src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-starter@6.0.0 server:dev 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\Oleg\AppData\Roaming\npm-cache\_logs17-07-28T12_52_25_647Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-starter@6.0.0 start: `npm run server:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-starter@6.0.0 start 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\Oleg\AppData\Roaming\npm-cache\_logs17-07-28T12_52_25_726Z-debug.log
这是angular 2相关的问题,在webpack.dev.js打字稿编译器无法启动,你能提供这个文件吗package.json。
这样就很容易找到错误
当我尝试 运行 server: npm start 时,我经常会遇到奇怪的错误。所以,我不知道如何解决这个问题,因为没有任何关于 Node.js 错误的解释。谁能说说有什么问题吗?
其中一个是:
> angular-starter@6.0.0 webpack-dev-server D:\Projects\UI
> node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js "--config" "config/webpack.dev.js" "--open" "--progress" "--profile" "--watch" "--content-base" "src/"
10% building modules 2/2 modules 0 activeError: listen EADDRINUSE 127.0.0.1:3000
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at Server._listen2 (net.js:1258:14)
at listen (net.js:1294:10)
at net.js:1404:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-starter@6.0.0 webpack-dev-server: `node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js "--config" "config/webpack.dev.js" "--open" "--progress" "--profile" "--watch" "--content-base" "src/"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-starter@6.0.0 webpack-dev-server 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\Oleg\AppData\Roaming\npm-cache\_logs17-07-28T12_52_25_565Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-starter@6.0.0 server:dev: `npm run webpack-dev-server -- --config config/webpack.dev.js --open --progress --profile --watch --content-base src/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-starter@6.0.0 server:dev 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\Oleg\AppData\Roaming\npm-cache\_logs17-07-28T12_52_25_647Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-starter@6.0.0 start: `npm run server:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-starter@6.0.0 start 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\Oleg\AppData\Roaming\npm-cache\_logs17-07-28T12_52_25_726Z-debug.log
这是angular 2相关的问题,在webpack.dev.js打字稿编译器无法启动,你能提供这个文件吗package.json。 这样就很容易找到错误