简体   繁体   中英

npm will not install Firebase

I am working on an Ionic app and want to include Firebase. Apparently, this is not as easy as it is for web pages. So, I followed this tutorial. Under "Setup the App", it says to

npm install angularfire2@4.0.0-rc0 firebase --save

which gave me the output

hacker_news_app_v2@0.0.1 
/home/sean/Dropbox/Programming/Ionic/hacker_news_app_v2
├── angularfire2@4.0.0-rc0 
└─┬ UNMET PEER DEPENDENCY firebase@4.1.2
  ├── jsonwebtoken@7.4.1 
  ├── ms@2.0.0 
  └── safe-buffer@5.1.0 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 
(node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"linux","arch":"x64"})
npm WARN angularfire2@4.0.0-rc0 requires a peer of firebase@^3.6.6 but 
none was installed.

So then I tried

sudo npm install firebase@4.1.2

which gave me

hacker_news_app_v2@0.0.1 
/home/sean/Dropbox/Programming/Ionic/hacker_news_app_v2
└── UNMET PEER DEPENDENCY firebase@4.1.2

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 
(node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"linux","arch":"x64"})
npm WARN angularfire2@4.0.0-rc0 requires a peer of firebase@^3.6.6 but 
none was installed.
npm ERR! code 1

(Why is there a caret in firebase@^3.6.6?)

So, finally, I tried

sudo npm install firebase@^3.6.6

which gave

- base64-url@1.3.3 node_modules/firebase/node_modules/base64-url
- rsvp@3.2.1 node_modules/firebase/node_modules/rsvp
hacker_news_app_v2@0.0.1 
/home/sean/Dropbox/Programming/Ionic/hacker_news_app_v2
└─┬ firebase@3.9.0  invalid
  ├── ecdsa-sig-formatter@1.0.9 
  ├── jsonwebtoken@7.4.0 
  ├── jwa@1.1.5 
  ├── moment@2.18.1 
  ├── ms@0.7.3 
  └── promise-polyfill@6.0.2 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 
(node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"linux","arch":"x64"})

Ok, so how do I interpret that last one? And how can I install angularfire?!

我运行sudo npm install firebase@latest并且它起作用了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM