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

Pin packages #3

Open
macabeus opened this issue Apr 4, 2020 · 2 comments
Open

Pin packages #3

macabeus opened this issue Apr 4, 2020 · 2 comments

Comments

@macabeus
Copy link

macabeus commented Apr 4, 2020

Is strongly recommended to pin the packages on package.json file, in order to avoid auto-upgrade, because it could break the application.

For example, instead of "showdown": "^1.9.1", is safer to write just "showdown": "1.9.1" (without ˆ).

@LorhanSohaky
Copy link
Member

I believe that npm-semver and package-lock.json guarantee this.

Caret Ranges:

  • ^1.2.3 := >=1.2.3 <2.0.0
  • ^0.2.3 := >=0.2.3 <0.3.0
  • ^0.0.3 := >=0.0.3 <0.0.4

Package-lock:

It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.

@macabeus
Copy link
Author

macabeus commented Apr 5, 2020

But it only works if the package maintainer's really set correctly the semantic version. And not, there are moments that they make mistakes, or on situations that "this is a very small edge case, let's add it as a minor", but it could break someone.

For example: on a release, express decided to add an exception when someone use the encoding utf8 instead of utf-8. It's a break change, but the guys decided to add it as a minor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants