2016-09-07 29 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 

编辑: 你不需要角通用的服务器端渲染了,因为它现在是角核心的一部分。

相关问题