Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js npm安装-g firebase工具导致错误_Node.js_Firebase_Google Cloud Functions_Nvm_Firebase Cli - Fatal编程技术网

Node.js npm安装-g firebase工具导致错误

Node.js npm安装-g firebase工具导致错误,node.js,firebase,google-cloud-functions,nvm,firebase-cli,Node.js,Firebase,Google Cloud Functions,Nvm,Firebase Cli,我正试图在我的终端上运行:npm install-g firebase tools,以便使用firebase函数 但当我这样做时,我会得到以下错误输出: npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! sysc

我正试图在我的终端上运行:
npm install-g firebase tools
,以便使用firebase函数

但当我这样做时,我会得到以下错误输出:

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   stack: "Error: EACCES: permission denied, access '/usr/local/lib/node_modules'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/myusername/.npm/_logs/2019-05-21T19_11_21_252Z-debug.log
我一直在经历这件事。和他们推荐的事情,但我是。要么误解了说明,要么就是说明不起作用

我在做什么:

  • 正在运行:
    curl-o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh |bash
  • 然后:
    命令-v nvm
    有时不返回任何内容,有时返回
    nvm
    ,即使在这种情况下,但运行firebases line失败

如何解决此问题?回答:我通过以下方式解决了此问题:

看起来您没有正确安装nvm,因为它没有将
节点
放在系统的
节点
之前的路径中。您可以看出它仍在尝试使用系统节点,因为您在它尝试访问的位置看到/usr/local。第一个项目符号不是这样做的吗?非常感谢您的指导。我在阅读文档时没有遇到任何问题。我不认为还有什么没说的。@DougStevenson见更新如果你对自己的问题有答案,你可以像平常一样回答。不要编辑带有答案的问题,因为这样会使问题在堆栈溢出时没有得到正式回答,并且不太可能在将来帮助其他人。