6-12 cli 问题

来源:6-12 静态资源服务器 12--cli & 版本

慕侠0355299

2018-08-31

执行以下命令报错,似乎是-p参数不识别?

$ node src/index.js -p 9999
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 127.0.0.1:9999
    at Server.setupListenHandle [as _listen2] (net.js:1335:14)
    at listenInCluster (net.js:1383:12)
    at doListen (net.js:1509:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at startup (internal/bootstrap/node.js:236:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)
Emitted 'error' event at:
    at emitErrorNT (net.js:1362:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)


写回答

1回答

慕侠0355299

提问者

2018-09-04

找到问题了:这是因为使用git bash 无法用ctr+c退出http node服务非正常退出,再次启动出现的问题: win10环境下 git bash 启动http服务之后无法用ctr+c 终止http 服务,直接用鼠标点中右上方“x”窗口退出git bash,再次启动git bash使用http node引起的无法正常启动http node服务,解决方法是另外启动一个git bash窗口使用tskill node命令结束那个127.0.0.1 http node服务可以防止此问题出现。

2
2
姓廖名方正清
6666
2019-04-29
共2条回复

Node.js入门到企业Web开发中的应用

Node.js是Web应用开发的一个福音,特别适合中小型系统的快速开发!

1580 学习 · 303 问题

查看课程