简体   繁体   English

Npm 安装 Firebase 时出现 EACCESS 错误

[英]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.

相关问题 在 React Native 的应用程序消息中安装 Firebase 时出错 - Error Installing Firebase In App Messaging in React Native Firebase Cloud Functions - npm 依赖项的“未定义”错误以及包含带有客户端代码的模块 - Firebase Cloud Functions - "not defined" error for npm dependency & including a module with client side code 错误:内部 firebase 函数,与 nodemailer 一起使用时 - Error:INTERNAL firebase functions ,when using it with nodemailer 尝试将图像上传到 Firebase 存储时出错 - Error when trying to upload images to Firebase storage 在 vue 3 中安装 firebase - 未创建文件 - Installing firebase in vue 3 - no files created 在 Ubuntu 上安装 Google Cloud SDK 时出错,如何解决? - Error when installing Google Cloud SDK on Ubuntu, how to fix? npm安装firebase总是失败 - npm install firebase always fails 从 npm 私人仓库在 gitlabci 中安装 npm package - installing a npm package in gitlabci from npm private repo 部署Firebase云function时这个错误是什么意思 - What does this error mean when deploying Firebase cloud function 运行 firebase 部署时,在 flutter 应用程序上 1:1 时解析错误意外令牌 '��' - Parse error Unexpected token '�' at 1:1 ��{ on flutter app when running firebase deploy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM