Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is yarn_install preferred over npm_install? #403

Closed
haikalpribadi opened this issue Nov 2, 2018 · 3 comments
Closed

Why is yarn_install preferred over npm_install? #403

haikalpribadi opened this issue Nov 2, 2018 · 3 comments
Labels
question/docs Answer users question, preferably by updating docs

Comments

@haikalpribadi
Copy link

Hi @gregmagolan and @alexeagle,

In the README.md#182 you wrote that yarn_install is preferred over npm_install. Why is that?

We're migrating our repo to Bazel right now and we have some packages built with Yarn, and some with NPM. We want to just pick one, and we're currently siding with NPM, but we can choose Yarn instead if there are strong benefits on why Bazel prefers Yarn.

Thank you!

@gregmagolan gregmagolan added the question/docs Answer users question, preferably by updating docs label Nov 8, 2018
@gregmagolan
Copy link
Collaborator

I believe the main reason is performance. The yarn_install rule will use the global yarn cache by default which makes subsequent yarn installs faster as they can fetch packages from the local cache. The option is use_global_yarn_cache on yarn_install which defaults to True. That being said, all our tests are run on both npm_install and yarn_install and both should work in all cases.

@alexeagle
Copy link
Collaborator

Another reason is that yarn's lockfile semantics and correctness are a bit better than NPMs.

@gregmagolan
Copy link
Collaborator

Also this: #416

alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Oct 17, 2020
- files that weren't staged after on-version.js
- karma version from upstream (for local dev)
- missing internal/BUILD file in the npm package

Also Deprecate rules_typescript_dependencies

it contains only rules_nodejs which users will have to install first anyway

Closes bazelbuild#403

PiperOrigin-RevId: 232371626
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Oct 18, 2020
- files that weren't staged after on-version.js
- karma version from upstream (for local dev)
- missing internal/BUILD file in the npm package

Also Deprecate rules_typescript_dependencies

it contains only rules_nodejs which users will have to install first anyway

Closes bazelbuild#403

PiperOrigin-RevId: 232371626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question/docs Answer users question, preferably by updating docs
Projects
None yet
Development

No branches or pull requests

3 participants