无法执行“sudo npm安装——保存firebase-admin”

时间:2022-02-14 20:40:36

i'm unable to perform sudo npm install --save firebase-admin in terminal. The error I'm getting is:

我无法执行sudo npm安装——在终端保存firebase-admin。我得到的错误是:

npm WARN package.json crypto@0.0.3 crypto is also the name of a node core module.
npm WARN package.json express-resource@1.0.0 No repository field.

npm ERR! Error: Invalid Package: expected types/jsonwebtoken but found @types/jsonwebtoken

npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache/add-local-tarball.js:161:14
npm ERR!     at process._tickCallback (node.js:448:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 16.1.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "firebase-admin"
npm ERR! cwd /Users/Henry/work_space/ServerMain
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! not ok code 0

I don't see types/jsonwebtoken or anything in my package.json file. I'm suspecting this could be because my node and firebase is out of date? my node is 1.4.28 and my firebase is 2.4.2. Let me know if you guys have any ideas!

我在包中看不到类型/jsonwebtoken或任何东西。json文件。我怀疑这可能是因为我的节点和firebase过时了?我的节点是1.4.28,我的firebase是2.4.2。如果你们有什么想法,请告诉我!

1 个解决方案

#1


3  

If you're suspecting that your Node is out of date then have you tried to install it with a newer version of Node? - i.e. What Have You Tried?

如果您怀疑您的节点已经过时,那么您是否尝试使用更新版本的节点来安装它?-你试过什么?

First of all your Node is not v1.4.28 but v0.10.38 - read your own question, it's right there.

首先,您的节点不是v1.4.28,而是v0.10.38——阅读您自己的问题,它就在那里。

Node 0.10 was released on March 2013 and stopped being maintained on October 2016. Its current status is "End-of-Life" so don't expect it to work for any new modules, unless those modules explicitly state that they work with that version of Node (which this one doesn't) and even then don't expect it to work well. See the Node LTS schedule:

节点0.10于2013年3月发布,2016年10月停止维护。它的当前状态是“生命的终结”,所以不要期望它对任何新模块都适用,除非这些模块明确地声明它们与那个版本的节点(这个没有)一起工作,甚至不要期望它工作得很好。见节点LTS进度表:

无法执行“sudo npm安装——保存firebase-admin”

Node 0.10 uses a very old version of V8 (3.14.5.x) so you can't even use modern JavaScript. By contrast Node 7.2.0 uses V8 version 5.4.500.43. See V8 Changelog to know was changed in the meantime.

节点0.10使用了非常旧的V8版本(3.14.5.x),因此您甚至不能使用现代JavaScript。相比之下,节点7.2.0使用V8版本5.4.5 .43。看V8 Changelog知道同时发生了变化。

Even io.js was forked from Node 0.12 because of not incorporating V8 releases fast enough in 0.12 and you're using a version that's even older than that.

甚至io。js是从节点0.12分离出来的,因为在0.12中没有以足够快的速度集成V8版本,而您使用的版本甚至更老。

There is no reason to use Node 0.10 when new versions are available for free.

当免费提供新版本时,没有理由使用节点0.10。

If you don't know how to install a newer version of Node then see my tutorial or Node website.

如果您不知道如何安装新版本的Node,请参阅我的教程或Node网站。

#1


3  

If you're suspecting that your Node is out of date then have you tried to install it with a newer version of Node? - i.e. What Have You Tried?

如果您怀疑您的节点已经过时,那么您是否尝试使用更新版本的节点来安装它?-你试过什么?

First of all your Node is not v1.4.28 but v0.10.38 - read your own question, it's right there.

首先,您的节点不是v1.4.28,而是v0.10.38——阅读您自己的问题,它就在那里。

Node 0.10 was released on March 2013 and stopped being maintained on October 2016. Its current status is "End-of-Life" so don't expect it to work for any new modules, unless those modules explicitly state that they work with that version of Node (which this one doesn't) and even then don't expect it to work well. See the Node LTS schedule:

节点0.10于2013年3月发布,2016年10月停止维护。它的当前状态是“生命的终结”,所以不要期望它对任何新模块都适用,除非这些模块明确地声明它们与那个版本的节点(这个没有)一起工作,甚至不要期望它工作得很好。见节点LTS进度表:

无法执行“sudo npm安装——保存firebase-admin”

Node 0.10 uses a very old version of V8 (3.14.5.x) so you can't even use modern JavaScript. By contrast Node 7.2.0 uses V8 version 5.4.500.43. See V8 Changelog to know was changed in the meantime.

节点0.10使用了非常旧的V8版本(3.14.5.x),因此您甚至不能使用现代JavaScript。相比之下,节点7.2.0使用V8版本5.4.5 .43。看V8 Changelog知道同时发生了变化。

Even io.js was forked from Node 0.12 because of not incorporating V8 releases fast enough in 0.12 and you're using a version that's even older than that.

甚至io。js是从节点0.12分离出来的,因为在0.12中没有以足够快的速度集成V8版本,而您使用的版本甚至更老。

There is no reason to use Node 0.10 when new versions are available for free.

当免费提供新版本时,没有理由使用节点0.10。

If you don't know how to install a newer version of Node then see my tutorial or Node website.

如果您不知道如何安装新版本的Node,请参阅我的教程或Node网站。