8

angular2-universal的维护者没有更新他们的网站:

问题 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。

4

3 回答 3

18

解决的办法是单独安装node和--globalflag,因为它是唯一需要全局安装的。

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

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

于 2017-01-31T00:53:15.523 回答
0
于 2016-09-07T10:34:20.630 回答
0

随着 typescript 的一些变化以及 Universal 团队加班工作以将 Universal 更新到 Angular rc5 和 rc6 的最新版本,文档方面的事情已经有点落后了。如果您想快速入门,请在https://github.com/angular/universal-starter上查看适合您的通用入门套件。

于 2016-09-08T15:22:09.547 回答