在ubuntu上安装socket.io

php*_*r12 6 ubuntu real-time node.js socket.io

我正在开发一个实时应用程序,我正在使用第三方来完成它.但是现在我必须将node.js与socket.io一起使用而不是第三方.

我正确安装了node.js(v0.4.12)并使用命令检查它node -v.但是当我使用npm install socket.io命令安装socket.io时,我收到了这个错误.

npm ERR! install failed Error: Required package: options(latest) not found. (Found: ["0.0.3"])
npm ERR! install failed (required by: ws@0.4.23)
npm ERR! install failed     at /usr/share/npm/lib/build.js:192:19
npm ERR! install failed     at cb (/usr/share/npm/lib/utils/graceful-fs.js:32:9)
npm ERR! Error: Required package: options(latest) not found. (Found: ["0.0.3"])
npm ERR! (required by: ws@0.4.23)
npm ERR!     at /usr/share/npm/lib/build.js:192:19
npm ERR!     at cb (/usr/share/npm/lib/utils/graceful-fs.js:32:9)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok
Run Code Online (Sandbox Code Playgroud)

我怎么解决呢?

php*_*r12 14

我运行了这些命令并且它有效:

  1. sudo npm install -g n
  2. sudo n 0.8.15
  3. sudo npm install socket.io