firebase npm 工具安装问题

问题描述 投票:0回答:1
> npm install -g firebase-tools
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path C:\Users\berk.BERK-PC\Desktop\'~\.npm-global'\node_modules\firebase-tools\node_modules\protobufjs
npm ERR! command failed
npm ERR! command C:\Users\berk.BERK-PC\.cache\firebase\runtime/shell.bat -c -- node scripts/postinstall
npm ERR! '--' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\berk.BERK-PC\AppData\Local\npm-cache\_logs\2023-11-09T22_29_32_163Z-debug-0.log

我需要下载工具,但我不能,有人可以帮助我解决这个问题吗?

npm-install firebase-tools npm-package
1个回答
0
投票

protobufjs 包中发生错误,该包似乎由 firebase-tools 使用。就像你在下面看到的那样。

npm ERR! path C:\Users\berk.BERK-PC\Desktop\'~\.npm-global'\node_modules\firebase-tools\node_modules\protobufjs

那么这似乎是真正的问题。

npm ERR! '--' is not recognized as an internal or external command,

我会做什么, 根据您提供的少量信息 并且由于错误似乎不是来自您输入的命令。

更新npm

npm install -g npm

清除缓存

npm cache clean -f

然后再次尝试重新安装。

我无法重新创建您的问题,也不知道您正在使用什么版本的 npm 和节点,如果有更多信息,我可能可以提供更好的帮助。

比如您正在使用什么操作系统 节点版本 npm 版本

或者

或者,如果您使用的是 Mac 或 Linux,则可以使用 Homebrew 安装 Firebase CLI。

https://formulae.brew.sh/formula/firebase-cli

© www.soinside.com 2019 - 2024. All rights reserved.