不能水锁安装

时间:2015-03-31 08:54:48

标签: node.js sails.js waterlock

对于API键,我想使用水锁JWT。但我无法安装水锁。错误消息显示如下。

 npm WARN locking Error: EACCES, open '/home/developer/.npm/_locks/waterlock-96592128476e35c7.lock'
npm WARN locking     at Error (native) 
npm WARN locking  /home/developer/.npm/_locks/waterlock-96592128476e35c7.lock failed { [Error: EACCES, open '/home/developer/.npm/_locks/waterlock-96592128476e35c7.lock']
npm WARN locking   errno: -13,
npm WARN locking   code: 'EACCES',
npm WARN locking   path: '/home/developer/.npm/_locks/waterlock-96592128476e35c7.lock' }
npm ERR! Linux 3.13.0-34-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "waterlock"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1

npm ERR! Attempt to unlock /home/developer/Desktop/Sails/AuthTest/node_modules/waterlock, which hasn't been locked
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/developer/Desktop/Sails/AuthTest/npm-debug.log

1 个答案:

答案 0 :(得分:2)

通常当你收到EACCES错误时,一个好的开始是看你是否对npm正在编写的文件夹有写权限(你在错误中得到了它,在这种情况下它是{{ 1}})。

您可以通过运行

查看是否拥有写权限
/home/developer/.npm

如果您看到类似

的内容
ls -l /home/developer/.npm

而不是

drwxr-xr-x  2 SOMEONE-ELSE SOMETHING-ELSE 4.0K Mar 26 16:43 bin

这意味着您的用户不拥有该目录,因此您可能希望运行

drwxr-xr-x  2 developer developer 4.0K Mar 26 16:43 bin

获得这些权利。