nvm忘记节点版本并默认为空:$ nvm ls:
.nvm
v0.11.12
v0.11.13
Run Code Online (Sandbox Code Playgroud)
我必须nvm use v.0.11.13在每个会话中继续打击:
.nvm
v0.11.12
-> v0.11.13
Run Code Online (Sandbox Code Playgroud)
我已经尝试了brew安装,以及官方安装脚本.
我.profile的brew版本:
#nvm
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
Run Code Online (Sandbox Code Playgroud)
对于install.sh脚本:
$ curl https://raw.githubusercontent.com/creationix/nvm/v0.10.0/install.sh | bash
#nvm
export NVM_DIR="/Users/farhad/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
Run Code Online (Sandbox Code Playgroud)
我刚用安装成功的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...");
Run Code Online (Sandbox Code Playgroud)
但这是投掷错误 -
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.<anonymous> (/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)
Run Code Online (Sandbox Code Playgroud)
端口8800已经使用ufw打开了. …