安装testacular时出错

时间:2012-11-04 14:33:02

标签: node.js angularjs karma-runner

我正在关注测试性视频教程http://vojtajina.github.com/testacular/

我安装了nodejs,当我尝试使用

安装testacular

sudo npm install -g testacular 我收到这个错误:

npm http GET https://registry.npmjs.org/testacular
npm http 304 https://registry.npmjs.org/testacular
npm http GET https://registry.npmjs.org/chokidar
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/chokidar
npm http 304 https://registry.npmjs.org/minimatch

> chokidar@0.4.0 postinstall /usr/local/lib/node_modules/testacular/node_modules/chokidar
> node setup.js postinstall

npm ERR! error installing chokidar@0.4.0
npm WARN This failure might be due to the use of legacy binary "node" 
npm WARN For further explanations, please read
npm WARN /usr/share/doc/nodejs/README.Debian
npm WARN 
npm ERR! error installing testacular@0.0.17

npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/testacular/node_modules/___minimatch.npm/package/minimatch.js'
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/adio/workspace/java/tutorial/angularJS/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "testacular"
npm ERR! cwd /home/adio/workspace/java/tutorial/angularJS
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! path /usr/local/lib/node_modules/testacular/node_modules/___minimatch.npm/package/minimatch.js
npm ERR! fstream_path /usr/local/lib/node_modules/testacular/node_modules/___minimatch.npm/package/minimatch.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, lstat '/usr/local/lib/node_modules/testacular/node_modules/___minimatch.npm/package/minimatch.js'
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (/usr/lib/nodejs/fstream/lib/writer.js:204:26)
npm ERR! error rolling back testacular@0.0.17 Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/testacular/node_modules/___glob.npm/package/test'

npm ERR! chokidar@0.4.0 postinstall: `node setup.js postinstall`
npm ERR! `sh "-c" "node setup.js postinstall"` failed with 1
npm ERR! 
npm ERR! Failed at the chokidar@0.4.0 postinstall script.
npm ERR! This is most likely a problem with the chokidar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node setup.js postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls chokidar
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "testacular"
npm ERR! cwd /home/adio/workspace/java/tutorial/angularJS
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! code ELIFECYCLE
npm ERR! message chokidar@0.4.0 postinstall: `node setup.js postinstall`
npm ERR! message `sh "-c" "node setup.js postinstall"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/adio/workspace/java/tutorial/angularJS/npm-debug.log
npm not ok

有人遇到过这个问题吗?

事先感谢您的帮助。

2 个答案:

答案 0 :(得分:1)

让我猜一下,它是在64位Win7机器上发生的吗?

我收到同样的错误,并且已在testacular github

上报告

我找到的唯一解决方法是安装node.js 32位而不是64位版本。 我鼓励你在他们的github上发表另一条评论,所以也许会重新考虑

答案 1 :(得分:0)

问题出现在错误日志建议的版本中。在Ubuntu 12.10上安装带有sudo apt-get install nodejs的NodeJS将导致安装nodejs 0.6,但你需要nodejs版本0.8才能安装testacular所以我按照本教程安装了nodejs 0.8

http://davidtsadler.com/archives/2012/05/06/installing-node-js-on-ubuntu/