2012-07-11 103 views
1

我是node.js的新手,我通過從節點網站運行安裝來安裝它。我有一個遊戲安裝包在全球範圍(如應該),但現在我想在我的Mac 安裝塔模塊,像這樣:安裝塔模塊時遇到的問題-WS模塊崩潰

sudo npm install tower -g 

它安裝了一堆東西,然後崩潰,與輸出

npm http 304 https://registry.npmjs.org/tinycolor 
npm http 304 https://registry.npmjs.org/zeparser/0.0.5 

> [email protected] install /usr/local/lib/node_modules/tower/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws 
> node install.js 

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied 

node.js:520 
var cwd = process.cwd(); 
       ^
Error: EACCES, permission denied 
at Function.startup.resolveArgv0 (node.js:520:23) 
at startup (node.js:54:13) 
at node.js:611:3 
npm ERR! [email protected] install: `node install.js` 
npm ERR! `sh "-c" "node install.js"` failed with 11 
npm ERR! 
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is most likely a problem with the ws 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 ws 
npm ERR! There is likely additional logging output above. 

如果我正確地閱讀它是ws(websockets?)模塊崩潰。

在研究這個問題時,我將節點路徑添加到我的.bashrc中,所以我已經完成了這個工作。

有什麼建議嗎?

+0

我會嘗試安裝節點與自制軟件,一切都很順利,然後。 'brew install node' – 2012-08-01 07:18:36

回答

0

多次實驗後,只有爲我工作的事就是enable the OSX root account,然後:

su 
npm install -g tower 

須藤沒有工作,但蘇做到了。

1

在這一行:

[email protected] install /usr/local/lib/node_modules/tower/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws

我們看到,WS是安裝在/ usr/local/lib目錄,我需要root寫在這裏沒有?

我使用Linux,它也許不是在MAC的情況下...

您應該使用sudo npm install -g towernvm安裝Node.js的。 Nvm關心模塊安裝在你的家裏,所以你不需要sudo。

+0

是的,正如我所說的,我確實使用了sudo。 – 2012-07-12 09:18:05