linux停止nodejs,node.js – 在linux重启后,nodejs消失了
我剛用安裝成功的nvm安裝了nodejs版本0.10.14.
在安裝nodejs之前,我安裝了zeromq 2.2.0版.
出于測試目的,我試圖在下面運行一個基本的pub示例.
var zmq = require('zmq');
var socket = zmq.socket('pub');
console.log("Binding socket on port 8800...");
socket.bind('tcp://localhost:8800', function(err){
if(err){
console.log(err)
} else{
console.log("listening on port 8800");
}
});
socket.send("hello this is testServer2 on port 8800...");
但這是投擲錯誤 –
events.js:72
throw er; // Unhandled 'error' event
^
TypeError: Socket is busy
at Socket._ioevents (/home/zishan/node_modules/zmq/lib/index.js:198:22)
at Socket._flush (/home/zishan/node_modules/zmq/lib/index.js:343:23)
at Socket.send (/home/zishan/node_modules/zmq/lib/index.js:318:42)
at Object. (/home/zishan/newsURLCollector/testServer2.js:16:8)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
端口8800已經(jīng)使用ufw打開了.
我試著谷歌搜索套接字繁忙的錯誤,但沒有運氣,我認為重新啟動Ubuntu是好的,問題變得更糟.當(dāng)我重新登錄并嘗試再次運行上述示例時,系統(tǒng)會拋出消息:
zishan@news01:~/newsURLCollector$node testServer2.js
The program 'node' can be found in the following packages:
* node
* nodejs-legacy
Try: sudo apt-get install
為什么地球上的工作節(jié)點停止工作并且無法找到節(jié)點.然后我按照系統(tǒng)提示,并在下面做了sudo apt-get install節(jié)點的結(jié)果:
zishan@news01:~$sudo apt-get install node
[sudo] password for zishan:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libpgm-5.1-0
Use 'apt-get autoremove' to remove it.
The following NEW packages will be installed
node
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/1,284 B of archives.
After this operation, 38.9 kB of additional disk space will be used.
Selecting previously unselected package node.
(Reading database ... 66172 files and directories currently installed.)
Unpacking node (from .../node_0.3.2-7.4_all.deb) ...
Processing triggers for man-db ...
Setting up node (0.3.2-7.4) ...
zishan@news01:~$node -v
然后我試圖找到節(jié)點版本,但沒有發(fā)生任何事情,我現(xiàn)在沒有得到節(jié)點提示,但當(dāng)我做“哪個節(jié)點”它說 – /usr/sbin / node
重啟后我不知道出了什么問題.任何人都可以解釋一下.
總結(jié)
以上是生活随笔為你收集整理的linux停止nodejs,node.js – 在linux重启后,nodejs消失了的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 用c语言批量删除指定文件夹,C语言删除文
- 下一篇: offset linux,Linux 宏