当我尝试在我的项目中使用 Ivy + Angular Universal 时出现错误。
我只有在 Ivy 模式下使用 Angular 时才会出现这个错误(当我在我的设置中设置enableIvy为 false 时,我tsconfig.app.json可以成功构建我的应用程序)。
以下是重现我的问题的步骤:
1. 与 Ivy 的新项目
ng new test-angular --enableIvy
2.添加Angular Universal
ng add @nguniversal/express-engine --clientProject test-angular
3. 当我执行 ng build 时出现错误
ERROR in Node does not exist: "path_to/node_modules/@nguniversal/express-engine"
我的 ng --version 输出是:
Angular CLI: 8.1.0
Node: 10.15.3
OS: win32 x64
Angular: 8.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router
Package Version
--------------------------------------------------------------------
@angular-devkit/architect 0.801.0
@angular-devkit/build-angular …Run Code Online (Sandbox Code Playgroud)