2016-09-07 45 views
5

angular2-universal維護者並沒有更新他們的網站:如何在網站上的文檔過時時安裝Angular2?

問題1)

typings install node express body-parser serve-static express-serve-static-core mime --ambient 
typings ERR! deprecated The "ambient" flag is deprecated. Please use "global" instead 

問題2)

typings install node express body-parser serve-static express-serve-static-core mime --global 
typings INFO globaldependencies "express" lists global dependencies on "node" that must be installed manually 
typings INFO globaldependencies "body-parser" lists global dependencies on "node" that must be installed manually 
typings ERR! message Unable to find "node" ("npm") in the registry. 
typings ERR! message However, we found "node" for 2 other sources: "dt" and "env" 
typings ERR! message You can install these using the "source" option. 
typings ERR! message We could use your help adding these typings to the registry: https://github.com/typings/registry 
typings ERR! caused by https://api.typings.org/entries/npm/node/versions/latest responded with 404, expected it to equal 200 

typings ERR! cwd /Users/davidmontgomery/Documents/frontend/green 
typings ERR! system Darwin 15.6.0 
typings ERR! command "/usr/local/bin/node" "/usr/local/bin/typings" "install" "node" "express" "body-parser" "serve-static" "express-serve-static-core" "mime" "--global" 
typings ERR! node -v v4.5.0 
typings ERR! typings -v 1.3.3 

typings ERR! If you need help, you may report this error at: 
typings ERR! <https://github.com/typings/typings/issues> 

請問該如何解決?我正在使用一個mac。

+0

嘿!不要忘記爲你的問題選擇正確的答案;-) –

回答

0

作爲版本1.0打字稿定義管理器的作了一些更新([見這裏] [1]),其中包括棄用--ambient標誌。周圍的

  • 用法現在全球
    • 這意味着在任何typings.json應該ambientDependencies改名globalDependencies任何ambientDevDependencies應 改名globalDevDependencies
    • 這也意味着現在--ambient--global ...

=>有關詳細信息,檢查了這一點。 [分型的github]:https://github.com/typings/typings [原創答案】:Ambient flag is deprecated

因此,你應該使用這種模式↓

typings install dt~PackageName --save --global

EX)低於typings install dt~body-parser --global --save

評論,如果您需要更多的幫助。

0

與一對夫婦的事情跨打字稿和通用團隊加班加點,以更新通用對角RC5和RC6的最新版本不斷變化,事情已經下降有點落後上的文檔前。 如果您想快速入門,請查看適用於您的通用入門套件https://github.com/angular/universal-starter

15

的解決方案是與--global標誌單獨安裝節點,因爲它是需要在全球範圍內安裝的唯一一個。

typings install dt~node --global 
typings install dt~express dt~body-parser dt~serve-static dt~express-serve-static-core dt~mime 

編輯: 你不需要角通用的服務器端渲染了,因爲它現在是角核心的一部分。

相關問題