我有一个Angular应用程序,我用Bazel构建并运行它。
现在,我正在尝试将此应用程序部署到heroku。
因此,我在package.json
文件中添加了两个scripts。
heroku-postbuild
用于构建Angular应用start
以启动Node.Js server,该服务为Angular应用提供服务 "scripts": {
"heroku-postbuild": "bazel build //...",
"start": "bazel run //client:prod_server_image",
},
但是,当我将此应用程序部署到Heroku时,在构建过程中会出现此错误:
INFO: Repository npm instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule yarn_install defined at:
/app/.cache/bazel/_bazel_u39132/75467578e335a7c29f7ca9e47bbaa16c/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:411:31: in <toplevel>
ERROR: An error occurred during the fetch of repository 'npm':
Traceback (most recent call last):
File "/app/.cache/bazel/_bazel_u39132/75467578e335a7c29f7ca9e47bbaa16c/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 404, column 13, in _yarn_install_impl
fail("yarn_install failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: yarn_install failed: [1/4] Resolving packages...
这是我正在谈论的应用程序:https://github.com/flolu/angular-bazel-starter/tree/56435be92280af932d7f5de7adb9aed49c90bb88