Firebase npm 工具安装问题

firebase npm tools install issue

提问人:skywalker 提问时间:11/10/2023 最后编辑:Frank van Puffelenskywalker 更新时间:11/10/2023 访问量:44

问:

> 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

评论


答:

0赞 Vernon van der Merwe 11/10/2023 #1

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 版本