这个错误是什么意思(protobufjs@6.11.2 postinstall: `node scripts/postinstall`)?

3

你好,我正在使用命令 npm install --save firebase 在Ubuntu控制台上安装Firebase,但在安装过程中遇到以下错误。 我尝试使用npm install protobufjs@6.11.2 来解决错误,但没有成功。 这个错误是什么意思呢?

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! protobufjs@6.11.2 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the protobufjs@6.11.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2个回答

3

npm尝试不以root用户身份运行protobuff postinstall脚本,当您尝试使用“sudo”命令以root用户身份运行它时,npm将会阻止。因此,在安装时需要使用--unsafe-perm标志。因此完整的命令将是:

sudo npm install --unsafe-perm -g firebase

这个方法非常有效,如果你需要在Windows上使用它,只需在以管理员身份打开的Git Bash中运行npm install --unsafe-perm -g firebase即可。 - Sandun Isuru Niraj

0

我不确定为什么会出现这个错误,但我的理解是它与某种权限问题有关。

您可以通过添加前缀Sudo来解决此错误。

sudo npm install --save firebas


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接