我知道Angular2 beta刚刚发布,但我无法从他们的官方网站教程(https://angular.io/guide/quickstart)重现这些步骤.也许有人有类似的问题,知道该怎么做才能解决这个问题?当我尝试使用npm start命令启动应用程序时,我得到如下输出:
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using npm@2.7.4
3 info using node@v0.12.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart angular2-quickstart@1.0.0
6 info start angular2-quickstart@1.0.0
7 verbose unsafe-perm in lifecycle true
8 info angular2-quickstart@1.0.0 Failed to exec start script
9 verbose stack Error: angular2-quickstart@1.0.0 start: `concurrent "npm run tsc:w" "npm run lite" `
9 verbose stack Exit …Run Code Online (Sandbox Code Playgroud) 围绕微软的botframework,当我尝试运行机器人的主要文件app.js文件时,第一次没问题,在我关闭机器人模拟器和所有程序之后,再次运行app.js,弹出此错误消息
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3978
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at Server.listen (net.js:1476:7)
at Server.listen (C:\Users\yu\Documents\GitHub\BotBuilder-
Samples\Node\cards-AdaptiveCards\node_modules\restify\lib\server.js:404:32)
at Object.<anonymous> (C:\Users\yu\Documents\GitHub\BotBuilder-
Samples\Node\cards-AdaptiveCards\app.js:10:8)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
Run Code Online (Sandbox Code Playgroud)
我找到了一些解决方案,看起来我第二次运行js文件时采用了端口3978,我必须使用cmd查找哪个任务正在使用该端口,然后终止任务.
C:\>netstat -aon|findstr 3978
Run Code Online (Sandbox Code Playgroud)
所以这个人正在接收港口,虽然我已经关闭了所有程序
TCP 0.0.0.0:3978 0.0.0.0:0 LISTENING 13140
TCP [::]:3978 [::]:0 LISTENING 13140
Run Code Online (Sandbox Code Playgroud)
实际上它是node.exe本身,它仍然在后台运行
C:\Users\yu>tasklist|findstr 13140
node.exe 13140 Console 1 42,064 K
Run Code Online (Sandbox Code Playgroud)
我需要杀死它
C:\Users\yu>taskkill /f /t /im node.exe
Run Code Online (Sandbox Code Playgroud)
当我想多次运行该文件时,有没有办法不总是重复这样做,它今天才开始连线,我的意思是所有不同的app.js文件,包括官方示例代码.在过去的一个月里,一切都很好,我使用的IDE是sublime text 3,node.js版本是8.9.4 …