执行setup.py发生错误,应该怎么解决。


#1

大家好,我按照项目维基中提供的部署方法,在Mac中部署开发环境,在执行了setup.py前边几步已经顺利完成了。但是执行setup.py的时候发生以下的错误:

bson@0.2.5 install /Users/apple/Documents/gitdemo/codecombat/coco/node_modules/mongoose/node_modules/mongodb/node_modules/bson
(node-gyp rebuild 2> builderror.log) || (exit 0)

CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/bson.node
SOLINK_MODULE(target) Release/bson.node: Finished
npm ERR! phantomjs@1.9.7-3 install: node install.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the phantomjs@1.9.7-3 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.1.0
npm ERR! command “node” “/usr/local/bin/npm” "install"
npm ERR! cwd /Users/apple/Documents/gitdemo/codecombat/coco
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.7
npm ERR! code ELIFECYCLE

ws@0.4.31 install /Users/apple/Documents/gitdemo/codecombat/coco/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/apple/Documents/gitdemo/codecombat/coco/npm-debug.log
npm ERR! not ok code 0
Traceback (most recent call last):
File “./coco/scripts/devSetup/setup.py”, line 46, in
setup.setup()
File “/Users/apple/Documents/gitdemo/codecombat/coco/scripts/devSetup/factories.py”, line 82, in setup
super(self.class, self).setup()
File “/Users/apple/Documents/gitdemo/codecombat/coco/scripts/devSetup/factories.py”, line 51, in setup
self.repoCloner.install_node_packages()
File “/Users/apple/Documents/gitdemo/codecombat/coco/scripts/devSetup/repositoryInstaller.py”, line 69, in install_node_packages
raise errors.CoCoError(u"Failed to install node packages")
errors.CoCoError: u’Failed to install node packages\n Please contact CodeCombat support, and include this error in your message.’

我应当怎么才能解决这个问题,希望知道的人帮一下忙,谢谢。


#2

这个问题每次发现,还是只有一次?有三个可能性:

  1. 没有C++编译器
  2. 碰到 internet connectivity problems
  3. 其他的

可以检查 npm-debug.log ?可能会有帮助。