【问题标题】:How to resolve error with webpack-dev-server? [duplicate]如何解决 webpack-dev-server 的错误? [复制]
【发布时间】:2017-07-28 12:56:23
【问题描述】:

当我尝试运行 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\_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

【问题讨论】:

  • 阅读错误信息。看起来 3000 端口已经在使用中。

标签: webpack webpack-dev-server


【解决方案1】:

这是 angular 2 相关问题,在 webpack.dev.js 中,打字稿编译器无法启动,您能否提供此文件以及 package.json。 这样就很容易找到错误了

【讨论】:

  • 是什么让你相信 typescript 编译器无法启动?
  • 我更有兴趣看到你的配置文件。错误出现在用于启动 ts 编译器的 webpack 开发服务器文件配置中
猜你喜欢
  • 2020-03-07
  • 1970-01-01
  • 1970-01-01
  • 2017-04-06
  • 1970-01-01
  • 2020-12-25
  • 1970-01-01
  • 1970-01-01
  • 2017-10-06
相关资源
最近更新 更多