[英]Angular - Adding Bazel Won't Create WORKSPACE or BUILD File
我刚刚通过运行ng new name
创建了一个新的 Angular 应用程序完成后我运行了(如文档中所述: https://angular.io/guide/bazel )
ng add @angular/bazel
将 Bazel 添加到我的项目中。
但是在这个命令完成后,我的项目中没有WORKSPACE
文件或任何BUILD
文件。 我对 Bazel 比较陌生,但我确定那些文件应该在那里?!
同样奇怪的是,当运行ng add @angular/bazel
时,我经常会得到这个错误:
An unhandled exception occurred: npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN tar write after end
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! A complete log of this run can be found in:
npm ERR! /home/flo/.npm/_logs/2020-02-13T09_42_26_044Z-debug.log
Package install failed, see above.
See "/tmp/ng-3enaGH/angular-errors.log" for further details.
默认情况下,WORKSPACE 和 BUILD.bazel 仅在需要时创建 - 在构建期间或 ng serve 运行时。
请参阅您上面引用的文档中的高级部分,了解如何更改默认值:
ng build --leaveBazelFilesOnDisk
对于你的第二个问题,我必须先将 node+angular 升级到最新的 LTS 版本,然后它才能为我工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.