-
Notifications
You must be signed in to change notification settings - Fork 357
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
Update Node/npm and dependencies #8045
Conversation
Update to v27 instead of latest to support WP <=6.5 which had support dropped in v28
Running into ❌ Rebuild dependencies Error message: npm error Traceback (most recent call last):
npm error File "/Users/vcanales/dev/themes/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
npm error import gyp # noqa: E402
npm error ^^^^^^^^^^
npm error File "/Users/vcanales/dev/themes/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
npm error import gyp.input
npm error File "/Users/vcanales/dev/themes/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
npm error from distutils.version import StrictVersion
npm error ModuleNotFoundError: No module named 'distutils'
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: `gyp` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess.onCpExit (/Users/vcanales/dev/themes/node_modules/node-gyp/lib/configure.js:259:16)
npm error gyp ERR! stack at ChildProcess.emit (node:events:519:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Darwin 23.6.0
npm error gyp ERR! command "/Users/vcanales/.nvm/versions/node/v20.14.0/bin/node" "/Users/vcanales/dev/themes/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm error gyp ERR! cwd /Users/vcanales/dev/themes/node_modules/node-sass
npm error gyp ERR! node -v v20.14.0
npm error gyp ERR! node-gyp -v v8.4.1
npm error gyp ERR! not ok
npm error Build failed with error code: 1 Unsure how I might help review this further; any suggestions? |
On the positive side, I was able to reproduce the issue. I cleaned the repo and ran |
@vcanales I figured it out. TL;DR Run Some themes depend on On MacOS this is done with Homebrew: On other systems it's done with PIP: I'll see if I can update all the themes using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified the changes and it works! 🚢
Changes proposed in this Pull Request:
Update node version and dependencies that support the new version. The node version bump was needed to support
URL.canParse()
in #8039, but I figured updating the dependencies would be nice while we're at it.Node version is now 20 to match core.
Most of the major version bumps were just dropping support for node 18 and 19, so no action was needed for many of them. There were a few exceptions.
husky@9
[changelog]: Required changes to.husky/pre-commit
andprepare
inpackage.json
.octokit@4
[changelog]: Dropped support for some features that we weren't using. Only used bycreate-a-theme-checklist.js
, but it looked like no code changes were needed.inquirer@10
[changelog]: Rewrite in TS, but was intended as a drop-in replacement. Used by some release workflows intheme-utils.mjs
. Seemed like no code changes needed.@wordpress/scripts@27
was intentionally left at v27 for WP <=6.5 support. See the v28 changelog for more info.wp-prettier
had a different installation method than was used for the current version, so I followed those instructions to reinstall the latest version. See the readme for more info.Related issue(s):