最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - npm fails to build socket.io with Error "Not compatible with your version of nodenpm: commander@0.5.0&

programmeradmin1浏览0评论

I cloned socket.io from .io.git bit it fails with the following Message

npm http GET .io-client/0.9.2
npm http 304 .io-client/0.9.2
npm http GET .2.5
npm http GET 
npm http GET .2.2
npm http GET .0.1
npm http 304 .2.5
npm http 304 .2.2
npm http 304 
npm http 304 .0.1

> [email protected] preinstall /usr/src/socket.io/node_modules/socket.io-client/node_modules/ws
> make

npm http GET .0.5
node-waf configure build
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
'configure' finished successfully (0.105s)
Waf: Entering directory `/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws/build'
[1/4] cxx: src/validation -> build/Release/src/validation_1.o
[2/4] cxx: src/bufferutil -> build/Release/src/bufferutil_2.o
[3/4] cxx_link: build/Release/src/validation_1.o -> build/Release/validation.node
[4/4] cxx_link: build/Release/src/bufferutil_2.o -> build/Release/bufferutil.node
Waf: Leaving directory `/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws/build'
'build' finished successfully (1.634s)
npm http GET .5.0
npm http GET 
npm http 304 .0.5
npm http GET .0.5.tgz
npm http 304 
npm http 304 .5.0
npm ERR! error rolling back [email protected] Error: ENOTEMPTY, rmdir '/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws'
npm ERR! error rolling back [email protected] Error: ENOTEMPTY, rmdir '/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/test'

npm ERR! Unsupported
npm ERR! Not patible with your version of node/npm: [email protected]
npm ERR! Required: {"node":">= 0.4.x < 0.7.0"}
npm ERR! Actual:   {"npm":"1.1.10","node":"0.7.7-pre"}
npm ERR! 
npm ERR! System Linux 2.6.38-11-generic
npm ERR! mand "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /usr/src/socket.io
npm ERR! node -v v0.7.7-pre
npm ERR! npm -v 1.1.10
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/src/socket.io/npm-debug.log
npm not ok

My current version of node and npm is as follows

root@abhibhat-VirtualBox:/usr/src/socket.io# node -v
v0.7.7-pre
root@abhibhat-VirtualBox:/usr/src/socket.io# npm -v
1.1.10
root@abhibhat-VirtualBox:/usr/src/socket.io# 
root@abhibhat-VirtualBox:/usr/src/socket.io# uname -a
Linux abhibhat-VirtualBox 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011 i686 i686 i386 GNU/Linux
root@abhibhat-VirtualBox:/usr/src/socket.io# 

Is it that my node version is higher than the supported upper limit? If so what is the solution?

I am clueless as to how to proceed from here. Please !!HELP!!

I cloned socket.io from https://github./LearnBoost/socket.io.git bit it fails with the following Message

npm http GET https://registry.npmjs/socket.io-client/0.9.2
npm http 304 https://registry.npmjs/socket.io-client/0.9.2
npm http GET https://registry.npmjs/uglify-js/1.2.5
npm http GET https://registry.npmjs/ws
npm http GET https://registry.npmjs/xmlhttprequest/1.2.2
npm http GET https://registry.npmjs/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs/uglify-js/1.2.5
npm http 304 https://registry.npmjs/xmlhttprequest/1.2.2
npm http 304 https://registry.npmjs/ws
npm http 304 https://registry.npmjs/active-x-obfuscator/0.0.1

> [email protected] preinstall /usr/src/socket.io/node_modules/socket.io-client/node_modules/ws
> make

npm http GET https://registry.npmjs/zeparser/0.0.5
node-waf configure build
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
'configure' finished successfully (0.105s)
Waf: Entering directory `/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws/build'
[1/4] cxx: src/validation -> build/Release/src/validation_1.o
[2/4] cxx: src/bufferutil -> build/Release/src/bufferutil_2.o
[3/4] cxx_link: build/Release/src/validation_1.o -> build/Release/validation.node
[4/4] cxx_link: build/Release/src/bufferutil_2.o -> build/Release/bufferutil.node
Waf: Leaving directory `/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws/build'
'build' finished successfully (1.634s)
npm http GET https://registry.npmjs/mander/0.5.0
npm http GET https://registry.npmjs/options
npm http 304 https://registry.npmjs/zeparser/0.0.5
npm http GET https://registry.npmjs/zeparser/-/zeparser-0.0.5.tgz
npm http 304 https://registry.npmjs/options
npm http 304 https://registry.npmjs/mander/0.5.0
npm ERR! error rolling back [email protected] Error: ENOTEMPTY, rmdir '/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws'
npm ERR! error rolling back [email protected] Error: ENOTEMPTY, rmdir '/usr/src/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/test'

npm ERR! Unsupported
npm ERR! Not patible with your version of node/npm: [email protected]
npm ERR! Required: {"node":">= 0.4.x < 0.7.0"}
npm ERR! Actual:   {"npm":"1.1.10","node":"0.7.7-pre"}
npm ERR! 
npm ERR! System Linux 2.6.38-11-generic
npm ERR! mand "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /usr/src/socket.io
npm ERR! node -v v0.7.7-pre
npm ERR! npm -v 1.1.10
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/src/socket.io/npm-debug.log
npm not ok

My current version of node and npm is as follows

root@abhibhat-VirtualBox:/usr/src/socket.io# node -v
v0.7.7-pre
root@abhibhat-VirtualBox:/usr/src/socket.io# npm -v
1.1.10
root@abhibhat-VirtualBox:/usr/src/socket.io# 
root@abhibhat-VirtualBox:/usr/src/socket.io# uname -a
Linux abhibhat-VirtualBox 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011 i686 i686 i386 GNU/Linux
root@abhibhat-VirtualBox:/usr/src/socket.io# 

Is it that my node version is higher than the supported upper limit? If so what is the solution?

I am clueless as to how to proceed from here. Please !!HELP!!

Share Improve this question edited May 13, 2016 at 5:27 Abhijit asked Mar 22, 2012 at 18:00 AbhijitAbhijit 63.8k19 gold badges142 silver badges209 bronze badges 3
  • The solution is to either use a node version that's supported, 0.6 is stable anyway. Or you could try editing the package.json file and removing the upper limit and see if it works with node v0.7. – fent Commented Mar 22, 2012 at 18:42
  • 1 @DeaDEnD: npm -f install socket.io just solved the issue. I checked package.json and there seems to be no upper limit "engines": { "node": ">= 0.4.0" }. Strangely I also had to issue npm -g list prior to issuing npm -f install, but how it solved the problem I am clueless. – Abhijit Commented Mar 22, 2012 at 19:08
  • Ah. I didn't know you could use the -f flag on installs. thanks! – fent Commented Mar 23, 2012 at 0:23
Add a ment  | 

1 Answer 1

Reset to default 4

npm -f install socket.io just solved the issue. I also checked package.json and there seems to be no upper limit "engines": { "node": ">= 0.4.0" }. Strangely I also had to issue npm -g list prior to issuing npm -f install, but how it solved the problem I am clueless.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论