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

Drop support for older versions of Node.js #2310

Merged
merged 3 commits into from
Nov 29, 2023
Merged

Drop support for older versions of Node.js #2310

merged 3 commits into from
Nov 29, 2023

Conversation

LinusU
Copy link
Collaborator

@LinusU LinusU commented Nov 27, 2023

Part of breaking changes discussed in #2232, this changes to align with LTS-supported Node.js versions

This changes the minimum supported versions of Node.js:

  • 16 and earlier = unsupported

  • 17 = unsupported

  • 18 = supported from 18.12.0 (LTS)

  • 19 = unsupported

  • 20 = supported from 20.9.0 (LTS)

  • 21 and later = not tested, but should work

  • Have you updated CHANGELOG.md?

@zbjornson
Copy link
Collaborator

 Traceback (most recent call last):
  File "/Users/runner/hostedtoolcache/node/20.9.0/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File "/Users/runner/hostedtoolcache/node/20.9.0/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
    import gyp.input
  File "/Users/runner/hostedtoolcache/node/20.9.0/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'

I had to fix this error in another package recently by adding this before npm install:

- run: pip install setuptools

@zbjornson zbjornson mentioned this pull request Nov 27, 2023
1 task
@LinusU LinusU mentioned this pull request Nov 28, 2023
8 tasks
@LinusU
Copy link
Collaborator Author

LinusU commented Nov 28, 2023

macOS test failures are fixed, but getting a strange error on Windows with Node.js 20:

  1. Canvas
    registerFont:
    Error: ENOENT: no such file or directory, lstat 'D:\a\node-canvas\node-canvas\examples\pfennigFont\pfennigMultiByte🚀.ttf'
    at Object.realpathSync (node:fs:2631:7)
    at registerFont (index.js:51:34)
    at Context. (test\canvas.test.js:116:5)
    at process.processImmediate (node:internal/timers:478:21)

I don't think it's related to the changes here though, just that we are now testing on Node.js 20.

We could allow failures for Windows/Node.js 20 for now? Or if you have any ideas on how to fix it @chearon? I don't have access to a windows machine myself 🙈 so it's going to be hard for me to debug...

@LinusU LinusU mentioned this pull request Nov 28, 2023
1 task
@LinusU
Copy link
Collaborator Author

LinusU commented Nov 29, 2023

I think that this is the issue:

nodejs/node#48673

It seems like it might be fixed with this PR:

nodejs/node#50650

Which hopefully lands in the next Node.js 20.x release.

Removing the 20.x test for Windows in the meantime.


Also, I think that we should make sure that this project is included in the node citgm so that new Node.js releases gets tested against Canvas. In that case this regression would have been caught...

Generally, I think that this approach (that is, test on lowest supported versions in our CI, and be included in CITGM to test latest Node.js version) is the best approach for larger projects like this, since I think that it's more likely that we accidentally introduce code that only works on newer versions of Node.js than our lowest supported, rather than Node.js introducing a breaking change...

@LinusU LinusU merged commit ad793da into master Nov 29, 2023
12 checks passed
@LinusU LinusU deleted the lu-min-node branch November 29, 2023 09:53
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.

3 participants