在npm start上运行我的jhipster应用时,我遇到一个错误

时间:2018-08-04 16:06:15

标签: angular webpack jhipster webpack-dev-server jhipster-registry

我是jhipster的初学者,并且有一些错误。我不知道为什么...用npm start运行我的jhipster应用程序时出现错误。

$ npm start

    > agrosfer@0.0.0 start C:\Users\pc\Desktop\acumen_network\DEV0408181449
    > yarn run webpack:dev

    yarn run v1.7.0
    $ yarn run webpack-dev-server -- --config webpack/webpack.dev.js --progress --inline --hot --profile --port=9060 --watch-content-base
    warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the
    scripts.
    $ node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack/webpack.dev.js --progress --inline --hot --profile --port=9060 --watch-content-base
     10% building modules 3/3 modules 0 active[HPM] Proxy created: [ '/api',
      '/management',
      '/swagger-resources',
      '/v2/api-docs',
      '/h2-console',
      '/auth' ]  ->  http://127.0.0.1:8080
    events.js:183
          throw er; // Unhandled 'error' event
          ^

    Error: listen EADDRINUSE 127.0.0.1:9060
        at Object._errnoException (util.js:992:11)
        at _exceptionWithHostPort (util.js:1014:20)
        at Server.setupListenHandle [as _listen2] (net.js:1355:14)
        at listenInCluster (net.js:1396:12)
        at GetAddrInfoReqWrap.doListen [as callback] (net.js:1505:7)
        at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    error Command failed with exit code 1.

2 个答案:

答案 0 :(得分:1)

发生此问题是因为该过程容易中断,例如停止了jhipster服务器。当您使用Ctrl + C关闭服务器时,有时关闭服务器会失败,因为您必须完全停止该过程并再次运行。

在cmd中运行以下命令:

  1. netstat -ano | findstr 9000
  2. taskkill / PID在此处输入您的PID / F

答案 1 :(得分:0)

您的端口9060正在使用,错误消息Error: listen EADDRINUSE 127.0.0.1:9060提示。

您可以更改端口或find并处理使用该端口的其他应用程序。