错误:EACCES,权限甚至在使用sudo后被拒绝?
我正在尝试设置一个Chrome扩展,它将自动保存我使用检查元素function对我的网站所做的更改。 这个想法是,你将能够实时更改网站,而不必回到IDE来保存更改,重新上传和一切。 该扩展名为DevTools Autosave。 我一直在按照这个网站的指示。 我试图在Mac上安装此。
我已经安装了node.js和扩展。 当我到达指令中的哪个部分时,我已经在“npm install -g autosave”命令前面尝试了使用和不使用“sudo”的命令,但是我总是得到这个错误:
Error: EACCES, permission denied at Function.startup.resolveArgv0 (node.js:815:23) at startup (node.js:58:13) at node.js:906:3 npm ERR! autosave@1.0.3 install: `node ./scripts/install.js` npm ERR! Exit status 8 npm ERR! npm ERR! Failed at the autosave@1.0.3 install script. npm ERR! This is most likely a problem with the autosave package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node ./scripts/install.js npm ERR! You can get their info via: npm ERR! npm owner ls autosave npm ERR! There is likely additional logging output above. npm ERR! System Darwin 14.0.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "autosave" npm ERR! cwd /Users/Brent npm ERR! node -v v0.10.33 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0
任何人都知道我可以解决这个问题? 我找不到任何人有这个问题,我现在已经在几个不同的论坛,但无法find解决scheme。 提前致谢。
你有两个select:要么修复你的npm
设置,所以你可以使用npm -g
,或者在本地安装autosave
。
要本地安装(即在当前目录中的node_modules
中),运行npm install autosave
node_modules
(不带-g
)。 然后你可以运行./node_modules/.bin/autosave
或./node_modules/autosave/bin/autosave
启动autosave
。
要修复你的npm
设置,所以你可以使用-g
没有root权限(推荐):
在你的家目录中(假设/Users/Brent/
),创build一个名为.npmrc
的文件,内容如下:
cache = /Users/Brent/.npm/cache globalconfig = /Users/Brent/.npm/npmrc globalignorefile = /Users/Brent/.npm/npmignore prefix = /Users/Brent/.npm
并将~/.npm/lib/node_modules
到NODE_PATH
,例如在.bashrc
(假设你的shell是bash)放置以允许find模块,并将〜/ .npm / bin附加to
PATH中, so you can run any installed binary (ie run
从任何地方so you can run any installed binary (ie run
自动保存):
export NODE_PATH=$HOME/.npm/lib/node_modules export PATH=$PATH:$HOME/.npm/bin
(对.bashrc
更改只在加载shell时生效,或者使用. ~/.bashrc
;如果要在不重新加载shell的情况下使用新安装程序,只需在当前shell中运行该行( export ...
) 。