Skip to content

Update Node.js & NPM #952

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

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open

Conversation

marinaaisa
Copy link
Member

@marinaaisa marinaaisa commented Jul 2, 2025

Bug/issue #137038442, if applicable:

Summary

This change updates Node.js to 22.17.0 & NPM to 10.9.2.
I chose 22.17.0 version of Node because it's the latest LTS (Long Term Support) version.

Dependencies

NA

Testing

Steps:

  1. Run rm -rf node_modules package-lock.json
  2. Run npm install
  3. Run npm run serve
  4. Run npm run test
  5. Check that everything works

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

@marinaaisa marinaaisa requested a review from mportiz08 July 2, 2025 15:50
@marinaaisa marinaaisa force-pushed the update-node branch 3 times, most recently from c2c82d5 to 19393a9 Compare July 3, 2025 13:07
@marinaaisa
Copy link
Member Author

@swift-ci test

@marinaaisa marinaaisa force-pushed the update-node branch 7 times, most recently from 8e0add4 to 83abe23 Compare July 9, 2025 11:01
@marinaaisa marinaaisa force-pushed the update-node branch 3 times, most recently from 0e6f08d to 42e07a6 Compare July 11, 2025 17:41
@marinaaisa
Copy link
Member Author

@swift-ci test

I chose this version of Node because:

- Latest LTS stability: It's the most recent Long Term Support version,
  providing stability and security updates until April 2026, making it
  ideal for production use.

- Maximum compatibility: It's the highest Node.js version that works
  seamlessly with all existing project dependencies without requiring
  any dependency upgrades.

Update Node.js & NPM to 22.17.0
Since highlight.js 11.6+, the `distributed` keyword is built-in and no
custom overrides are needed
Replace wrapper.find with wrapper.findComponent instead since
wrapper.find is deprecated
@marinaaisa
Copy link
Member Author

@swift-ci test

@marinaaisa
Copy link
Member Author

marinaaisa commented Jul 25, 2025

tree-sitter-vue is not compatible with Node.js 22.
This is because it uses tree-sitter v0.19.x, which does not support Node.js 22.

The version of tree-sitter that works with Node.js 22 is v0.21.0 or later, as it uses the new Node-API instead of NAN for its Node bindings. Since tree-sitter-vue hasn't been updated to use v0.21.0+, it doesn't work with Node.js 22.

Related: rdar://156714814

I opened a separate PR in case we want to delete the tree-sitter-vue dependency, since it doesn't work with Node 22.

marinaaisa added a commit to marinaaisa/swift-docker that referenced this pull request Jul 25, 2025
We need to update the Node version to 22.17.0 for the Swift CI to work
in Docc-render, since we are also updating Node in the project. [1]

[1] swiftlang/swift-docc-render#952
marinaaisa added a commit to marinaaisa/swift-docker that referenced this pull request Jul 25, 2025
We need to update the Node version to 22.17.0 in the Swift CI for
Docc-Render, to ensure compatibility with the updated Node version used
in the project. [1]

[1] swiftlang/swift-docc-render#952
@marinaaisa
Copy link
Member Author

marinaaisa commented Jul 25, 2025

Swift CI is failing because it's using Node 14.17.4 instead of Node 22.17.0

I opened a PR in Swift Docker to update the Node version in Docker to 22.17.0

Fixes: rdar://156708326

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

Successfully merging this pull request may close these issues.

1 participant