Skip to content

Packages: Publishing to npm fails for wp/X.Y branches because of older Node.js #53628

@gziolo

Description

@gziolo

Description

Additional context in #53565. While trying to manually publish WordPress packages to npm using the script executed from the local machine, I run into an error where npm ci failed because npm version set in trunk to be able to run the script doesn't meet the requirements for the branch where source code lives. In effect, the script bails out, and publishing isn't possible.

In effect, any backport to WordPress 6.3 and lower will fail from GitHub UI as explained:

https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/code/release.md#wordpress-releases

Everything should work correctly for WordPress 6.4, as the script and the future branch will use the same Node.js and npm versions.

Step-by-step reproduction instructions

I executed from trunk that is now on Node 16 and npm 8:

./bin/plugin/cli.js npm-latest --semver minor

It pulled changes from release/16.4 that was still on Node 14 and npm 6, so npm ci throws an error that it can finish when using npm 8.

The same issue will happen when trying to backport changes to WordPress core when using any of wp/X.Y branches that enforce usage of npm 6.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intendednpm PackagesRelated to npm packages

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions