无法使用npm安装firebase-admin [英] Can't install firebase-admin with npm

查看:82
本文介绍了无法使用npm安装firebase-admin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行以下命令来安装firebase-admin:npm install firebase-admin --save

I'm trying to run this command to install firebase-admin: npm install firebase-admin --save

当我尝试运行此命令时,出现以下错误:

When I try to run this command, I get the following error:

ENOENT: no such file or directory, rename 'D:\MyPath\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\abbrev' -> 'D:\MyPath\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\.abbrev.DELETE'

我尝试重新安装Node.js,尝试卸载先前版本的Node.js,尝试更新npm,几乎尝试了所有在线方法,但无济于事.如果我运行最新版本的Node.js,则没有出现此错误,而是出现以下错误:

I have tried reinstalling Node.js, I have tried uninstalling a previous version of Node.js, I have tried updating npm, I have tried pretty much everything online but nothing is helping. If I run the newest version of Node.js, instead of getting this error, I get the following error:

Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1

老实说,我已经为有相同问题的人尝试了几个GitHub线程,但是他们的解决方案都没有对我有用,所以我在这里尝试.有人可以帮我解决这个问题吗?

I have honestly tried several GitHub threads for people with the same problem but none of their solutions have worked for me, so I am trying here. Can anybody help me with this issue?

推荐答案

在进一步修改之后,看来我终于解决了问题,因此终于可以部署到Firebase.这些是我为解决此问题而采取的步骤:

Upon further tinkering with this, it looks like I finally solved my issue so i can finally deploy to Firebase. These are the steps I took to solve this problem:

  1. 首先,我使用npm uninstall firebase-admin命令卸载了firebase-admin.
  2. 我使用npm install firebase-admin命令重新安装了firebase-adming.这似乎无法解决我的问题,但您永远不会知道.
  3. 删除了 node_modules目录中的firebase-admin目录.
  4. 我运行了npm安装
  5. 我再次使用npm install firebase-admin --save
  6. 安装了firebase-admin目录
  7. 我跑了firebase deploy并且成功了!
  1. First, I uninstalled firebase-admin using the npm uninstall firebase-admin command.
  2. I reinstalled firebase-adming using the npm install firebase-admin command. This didn't seem to fix my issue, but you never know.
  3. I deleted the firebase-admin directory in the node_modules directory.
  4. I ran npm install
  5. I installed the firebase-admin directory again, this time using npm install firebase-admin --save
  6. I ran firebase deploy and it worked!

我不知道真正需要这些步骤中的多少,但最终它奏效了.

I don't know how many of those steps were truly necessary but in the end, it worked.

这篇关于无法使用npm安装firebase-admin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆