簡體   English   中英

npm 不會安裝 Firebase

[英]npm will not install Firebase

我正在開發一個 Ionic 應用程序並希望包含 Firebase。 顯然,這不像網頁那樣容易。 所以,我跟着這個教程。 在“設置應用程序”下,它說

npm install angularfire2@4.0.0-rc0 firebase --save

這給了我輸出

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.

所以我嘗試了

sudo npm install firebase@4.1.2

這給了我

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

(為什么 firebase@^3.6.6 中有插入符號?)

所以,最后,我試過了

sudo npm install firebase@^3.6.6

這給了

- 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"})

好的,那么我如何解釋最后一個? 我該如何安裝 angularfire?!

我運行sudo npm install firebase@latest並且它起作用了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM