環境:Mac 10.7.4, python 2.6.7, nodejs 0.10.26, pomelo 0.8.9node
下載 chatofpomelo, 執行 sudo sh npm-install.sh 的時候,出現以下錯誤python
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in <module>
sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 11.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Tom/Desktop/bitbucket/pd/server/game-server/node_modules/pomelo/node_modules/pomelo-rpc/node_modules/toobusy
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok git
在google後找到解決方法:由於本地的gyp module引發github
1) $ python -c 'import gyp; print gyp.__file__'
npm
/usr/lib/python2.6/site-packages/gyp/__init__.pyc
移動到某個文件夾
2) $ mv /usr/lib/python2.6/site-packages/gyp /usr/lib/python2.6/site-packages/gyp_backup
ui
確保python不能找到它
3) $ python -c 'import gyp; print gyp.__file__'
google
Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named gyp
再次執行
4) $ sudo sh npm-install.sh
code
能正常啓動game-serverserver
參考:ip