Why do I have to add entries to package.json? #1483
Unanswered
evanchaoli
asked this question in
Q&A
Replies: 1 comment
-
Does the angular example in https://github.com/aspect-build/bazel-examples have this issue? Can you reproduce the issue there to demonstrate the issue? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am following the Angular Example to migrate our Angular project to build with
rules_js
. I am new to Bazel, and I have managed to make the build work.But during the migration, I had to add some entries to
package.json
which I consider unexpected. So I want to check with the community if I missed something or did something wrong.Basically, before the migration, I could successfully build my project by
npm
:Following the example, I created
WORKSPACE.bazel
etc. files under my project, and updatedAPPLICATION_DEPS
indefs.bzl
with all entries frompackage.json
. After that, I ranbazel build --verbose_failures //:app
, and got errors like:The original
package.json
doesn't contain an entry oftslib
. But many other modules depend ontslib
,npm install
figured out the dependencies, and installedtslib
. So thatpackage-lock.json
contains an entry oftslib
:So I manually added
"tslib": "2.6.2",
topackage.json
and rannpm install
to updatepackage-lock.json
, and also addedtslib
toAPPLICATION_DEPS
indefs.bzl
. Then rerunbazel build --verbose_failures //:app
fixed the error.Similarly to
tslib
, I had to manually add quite a few other modules topackage.json
. Is that an expected behavior?After fixed all such "module not found" errors, I got the finally error:
Then I followed the hint message to run
npm i --save-dev @types/node
, which fixed the problem. But I wonder why purenpm run build
doesn't require to install@types/node
?Beta Was this translation helpful? Give feedback.
All reactions