wonghenry
wonghenry

Reputation: 689

Unable to perform "sudo npm install --save firebase-admin"

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

npm WARN package.json [email protected] crypto is also the name of a node core module.
npm WARN package.json [email protected] 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!

Upvotes: 2

Views: 895

Answers (1)

rsp
rsp

Reputation: 111298

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.

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:

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.

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.

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

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

Upvotes: 3

Related Questions