这个错误是什么意思(protobufjs@6.11.2postinstall:`节点脚本/postinstall`)



Hi我用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.

npm尝试不以root身份运行protobuff postinstall脚本,当您尝试以root身份使用"sudo";命令npm会试图阻止它。所以在安装时需要使用--unsafe perm标志。所以完整的命令看起来像sudo npm install --unsafe-perm -g firebase

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

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

sudo npm安装--保存firebas

最新更新