Dig*_*ent 5 terminal google-chrome-extension node.js google-chrome-devtools
我正在尝试设置一个Chrome扩展程序,它会使用inspect元素功能自动保存我对网站所做的更改.我们的想法是,您将能够对网站进行实时更改,而无需返回到ide以保存更改并重新上传所有内容.扩展名称为DevTools Autosave.我一直在遵循本网站的指示.我正在尝试在Mac上安装它.
我已经安装了node.js和扩展.当我到在其讲话的指示有关的命令,以在终端上运行的部分,我在前面有和没有的"命令"尝试"故宫安装-g自动保存"命令,但我总是得到这个错误:
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
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?我找不到任何有这个问题的人,我现在已经在几个不同的论坛,但找不到解决方案.提前致谢.
Rob*_*b W 11
您有两种选择:修复您的npm
设置,以便您可以在本地使用npm -g
或安装autosave
.
要在本地安装(即在node_modules
当前目录中),请运行npm install autosave
(不-g
).然后你可以跑./node_modules/.bin/autosave
或./node_modules/autosave/bin/autosave
开始autosave
.
要修复您的npm
设置,以便您可以在-g
没有root权限的情况下使用(推荐):
在您的主目录(假设/Users/Brent/
)中,创建一个.npmrc
使用以下内容调用的文件:
cache = /Users/Brent/.npm/cache
globalconfig = /Users/Brent/.npm/npmrc
globalignorefile = /Users/Brent/.npm/npmignore
prefix = /Users/Brent/.npm
Run Code Online (Sandbox Code Playgroud)
并添加~/.npm/lib/node_modules
到您的NODE_PATH
,例如通过将以下内容.bashrc
(假设您的shell是bash)允许找到模块,并从任何地方附加〜/ .npm/bin to
PATH autosave` so you can run any installed binary (i.e. run
:
export NODE_PATH=$HOME/.npm/lib/node_modules
export PATH=$PATH:$HOME/.npm/bin
Run Code Online (Sandbox Code Playgroud)
(更改.bashrc
仅在加载shell时生效,或者使用. ~/.bashrc
;如果要在不重新加载shell的情况下使用新设置,只需export ...
在当前shell中运行该行()).