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

Downgrade package-lock.json back to v1 #6618

Merged
merged 1 commit into from
Sep 21, 2021
Merged

Conversation

pierlon
Copy link
Contributor

@pierlon pierlon commented Sep 21, 2021

Summary

As @westonruter pointed out, the .nvmrc points to the lts version of node, which would install node v14 and npm v6 by default. However, the package-lock.json is using the v2 syntax which is generated by npm v7 (and later). Attempting to run npm install with npm v6 causes the package-lock.json to produce a massive diff as it downgrades the lockfile back to v1.

Also to note, Gutenberg and WP Core also currently use npm v6 and have their package-lock.json files in v1 format. Downgrading our lockfile to v1 to align with theirs will allow us developers to work across these projects without much hassle.

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@pierlon pierlon added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Sep 21, 2021
@pierlon pierlon added this to the v2.2 milestone Sep 21, 2021
@pierlon pierlon added this to Ready for Review in Ongoing Sep 21, 2021
@pierlon
Copy link
Contributor Author

pierlon commented Sep 21, 2021

One thing to note also is when node v16 and npm v7 become LTS next month, we might have to update .npmrc to v14, if Gutenberg (or Core) is still using the lockfile v1 format.

@github-actions
Copy link
Contributor

Plugin builds for d0c2a01 are ready 🛎️!

@pierlon
Copy link
Contributor Author

pierlon commented Sep 21, 2021

Also to mention, Gutenberg is planning to upgrade their package-lock.json to v2 format: WordPress/gutenberg#33892. Once that is done Core should be on their way to update theirs as well: WordPress/wordpress-develop#1146 (comment).

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@westonruter westonruter merged commit 87f2ee3 into develop Sep 21, 2021
@westonruter westonruter deleted the downgrade-npm-lockfile branch September 21, 2021 19:20
@pierlon pierlon mentioned this pull request Sep 24, 2021
2 tasks
@pierlon pierlon moved this from Ready for Review to Ready for QA in Ongoing Sep 30, 2021
@westonruter westonruter moved this from Ready for QA to Done in Ongoing Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
Ongoing
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants