0

安装时出现此错误...如何安装?谁能帮我??

localhost:~ rammanikannta$ git clone git://github.com/germallon/phonegapbuildapi.git 
Cloning into 'phonegapbuildapi'...
remote: Counting objects: 190, done.    
remote: Compressing objects: 100% (89/89), done.    
remote: Total 190 (delta 106), reused 180 (delta 97)    
Receiving objects: 100% (190/190), 59.61 KiB | 0 bytes/s, done.    
Resolving deltas: 100% (106/106), done.    
Checking connectivity... done    

localhost:~ rammanikannta$ cd phonegapbuildapi    

localhost:phonegapbuildapi rammanikannta$ npm link    
npm ERR! Error: EACCES, symlink '/Users/rammanikannta/phonegapbuildapi'    
npm ERR!  { [Error: EACCES, symlink '/Users/rammanikannta/phonegapbuildapi']    
npm ERR!   errno: 3,    
npm ERR!   code: 'EACCES',    
npm ERR!   path: '/Users/rammanikannta/phonegapbuildapi' }    
npm ERR!     
npm ERR! Please try running this command again as root/Administrator.    
npm ERR! System Darwin 12.5.0    
npm ERR! command "node" "/usr/local/bin/npm" "link"    
npm ERR! cwd /Users/rammanikannta/phonegapbuildapi    
npm ERR! node -v v0.10.20    
npm ERR! npm -v 1.3.11    
npm ERR! path /Users/rammanikannta/phonegapbuildapi    
npm ERR! code EACCES    
npm ERR! errno 3    
npm ERR! stack Error: EACCES, symlink '/Users/rammanikannta/phonegapbuildapi'    
npm ERR!     
npm ERR! Additional logging details can be found in:    
npm ERR!     /Users/rammanikannta/phonegapbuildapi/npm-debug.log    
npm ERR! not ok code 0
4

2 回答 2

0

看到:Please try running this command again as root/Administrator. 试试sudo npm link

于 2013-10-05T08:36:51.953 回答
0

以 root 身份运行npm link命令:

$ sudo npm link

(假设用户rammanikannta是管理员)。

当要求输入密码时,输入您自己的密码。

这样做的原因是它npm link试图创建一个从全局node_modules目录到您下载的符号链接phonegapbuildapi,而您可能没有创建该符号链接的正确权限。

于 2013-10-05T08:37:00.100 回答