当我尝试运行服务器时,我常常会遇到奇怪的错误:npm start。所以,我不知道如何解决这个问题,因为Node没有任何关于错误的解释。有谁能说什么问题?
关于他们是:
> 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\_logs\2017-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\_logs\2017-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\_logs\2017-07-28T12_52_25_726Z-debug.log
答案 0 :(得分:0)
这是与角度2相关的问题,在webpack.dev.js中,typescript编译器无法启动,你能提供这个文件以及package.json吗? 因此很容易找到错误