[英]Npm EACCESS error when installing Firebase
I used to be able to run and deploy my code using firebase.我曾经能够使用 firebase 运行和部署我的代码。 I then upgraded to the new m1 MacBook pro.
然后我升级到新的 m1 MacBook pro。 I git cloned my code and made some minor changes.
我 git 克隆了我的代码并做了一些小改动。 I tried using
我尝试使用
firebase deploy
but I got the error message但我收到了错误信息
zsh: command not found: firebase
then I tried然后我尝试了
npm install -g firebase-tools
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated debug@4.1.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/firebase-tools/lib/bin/firebase.js
npm ERR! dest /usr/local/bin/firebase
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/lib/bin/firebase.js' -> '/usr/local/bin/firebase'
npm ERR! [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/lib/bin/firebase.js' -> '/usr/local/bin/firebase'] {
npm ERR! cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/lib/bin/firebase.js' -> '/usr/local/bin/firebase'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/firebase-tools/lib/bin/firebase.js',
npm ERR! dest: '/usr/local/bin/firebase'
npm ERR! },
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/firebase-tools/lib/bin/firebase.js',
npm ERR! dest: '/usr/local/bin/firebase'
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.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/brennanadams/.npm/_logs/2020-12-03T18_52_42_463Z-debug.log
I looked this up on the internet but I have yet to find a solution, any help is appreciated.我在互联网上查找了这个,但我还没有找到解决方案,感谢任何帮助。 I am not sure if this is because I have the m1 chip and it not compatible or if a bunch of my settings reset when I upgraded.
我不确定这是因为我的 m1 芯片不兼容,还是因为我升级时重置了一堆设置。 Thank you for help.
谢谢你的帮助。
To install an npm package globally on Mac, try running with the sudo
command.要在 Mac 上全局安装 npm package,请尝试使用
sudo
命令运行。 You'll need to enter your password.您需要输入密码。
sudo npm install -g firebase-tools
EDIT : Original title for this question asked about the request
deprecation which is why I spend a paragraph explaining that's not the real problem before getting to what the real issue is and what needs to be done.编辑:这个问题的原始标题询问了
request
弃用,这就是为什么我花了一段解释这不是真正的问题,然后才了解真正的问题是什么以及需要做什么。
Regarding request
: You don't need to do anything about that.关于
request
:您无需对此做任何事情。 request
will continue working just fine as a dependency of firebase
. request
将作为firebase
的依赖项继续正常工作。 Hopefully, they will replace it with something else at some point, but there's no issue to address.希望他们会在某个时候用其他东西代替它,但没有问题需要解决。 The deprecation of the
request
module was done as a proactive measure to push people to more actively-maintained and modern solutions.弃用
request
模块是作为一种主动措施来推动人们采用更积极维护和更现代的解决方案。 It wasn't because there's something fundamentally broken with request
that requires people to move to something else now now now or anything like that.这并不是因为从根本上破坏了
request
人们现在现在就转移到其他地方或类似的东西。
Instead, your problem here is the EACCESS
issue .相反,您的问题是
EACCESS
问题。 For that, you'll want to review the npm
documentation on that problem .为此,您需要查看有关该问题的
npm
文档。 The upshot is you probably want to reinstall Node.js with a version manager such as nvm
.结果是您可能希望使用诸如 nvm 之类的版本管理器重新安装
nvm
。 If you can't or don't want to do that, you can configure npm
to install global packages in a directory that you have write permission to .如果您不能或不想这样做,您可以配置
npm
以将全局包安装在您具有写入权限的目录中。
It worked with Yarn, Try:它适用于 Yarn,尝试:
yarn global add firebase-tools
export PATH="$(yarn global bin):$PATH"
command -v firebase
and firebase login will work normally和 firebase 登录将正常工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.