我正在尝试在 Cygwin(Windows 7)上使用 NPM 安装一些模块,但安装过程非常不一致。有些软件包在安装时反复失败,但有些成功;此外,同一个包可能会失败多次,然后在系统没有任何变化的情况下成功。安装markdown包连续失败了3次,然后又成功了。失败是:
npm ERR! couldn't unpack /tmp/npm-1310104605595/1310104605596-0.844648783095181/
tmp.tgz to /tmp/npm-1310104605595/1310104605596-0.844648783095181/contents
npm ERR! Error: EACCES, Permission denied '/tmp/npm-1310104605595/1310104605596-
0.844648783095181/contents/___package.npm/package'
npm ERR!
npm ERR! Please use 'sudo' or log in as root to run this command.
npm ERR!
npm ERR! sudo npm "install" "markdown"
npm ERR!
npm ERR! or set the 'unsafe-perm' config var to true.
npm ERR!
npm ERR! npm config set unsafe-perm true
npm ERR!
npm ERR! System CYGWIN_NT-6.1-WOW64 1.7.9(0.237/5/3)
npm ERR! command "node" "/usr/local/bin/npm" "install" "markdown"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/Paul/node_modules/express/node_modules/connect/npm-debug.log
npm not ok
有没有人经历过这种情况,如果有,解决方案是什么?是的,我已经设置了 unsafe-perm 配置变量,它似乎并没有改变任何东西......而且,这不仅限于这个包;我尝试安装的几乎所有东西似乎都有这个问题。