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
Uh oh!
There was an error while loading. Please reload this page.
-
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.jsonwhich 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.bazeletc. files under my project, and updatedAPPLICATION_DEPSindefs.bzlwith all entries frompackage.json. After that, I ranbazel build --verbose_failures //:app, and got errors like:The original
package.jsondoesn't contain an entry oftslib. But many other modules depend ontslib,npm installfigured out the dependencies, and installedtslib. So thatpackage-lock.jsoncontains an entry oftslib:So I manually added
"tslib": "2.6.2",topackage.jsonand rannpm installto updatepackage-lock.json, and also addedtslibtoAPPLICATION_DEPSindefs.bzl. Then rerunbazel build --verbose_failures //:appfixed 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 builddoesn't require to install@types/node?Beta Was this translation helpful? Give feedback.
All reactions