Skip to content

Update Node.js from v14 to v22 (current LTS) #536

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 7 commits into
base: master
Choose a base branch
from

Conversation

kili-ilo
Copy link
Contributor

Node.js v14 reached end-of-life in 2023. This will make it easier and safer to work with this repo.

Closes #482
Succeeds #484

~/_code/hfg-gmuend/openmoji 🌿 npm install
npm warn old lockfile
npm warn old lockfile The package-lock.json file was created with an old version of npm,
npm warn old lockfile so supplemental metadata must be fetched from the registry.
npm warn old lockfile
npm warn old lockfile This is a one-time fix-up, please be patient...
npm warn old lockfile

up to date, audited 319 packages in 1s

56 packages are looking for funding
  run `npm fund` for details

21 vulnerabilities (8 moderate, 10 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
~/_code/hfg-gmuend/openmoji 🌿

@kili-ilo
Copy link
Contributor Author

kili-ilo commented Apr 13, 2025

I successfully ran npm run export-svg and npm run generate-font on this branch.

@kili-ilo
Copy link
Contributor Author

npm test barely fails, but I see the same result on my branch for #535 (and I'm unable to npm install on master).

Saved working directory and index state WIP on update_node_version: 6169ae0a2 Update Node.js from v14 to v22 (curr
~/_code/hfg-gmuend/openmoji 🌿 npm test

> [email protected] test
> mocha --parallel --reporter min test/*.{js,mjs} --openmoji-data-json $PWD/data/openmoji.json --openmoji-src-fold



































  77944 passing (32s)
  1 failing

  1) Uncaught error outside test suite:
     Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
      at Object.basename (node:path:1404:5)
      at /home/jan/_code/hfg-gmuend/openmoji/test/file-exists-src.js:30:28
      at Array.forEach (<anonymous>)
      at Suite.<anonymous> (test/file-exists-src.js:28:14)
      at Suite.<anonymous> (test/file-exists-src.js:27:3)
      at Object.<anonymous> (test/file-exists-src.js:14:1)



~/_code/hfg-gmuend/openmoji 🌿

@kili-ilo
Copy link
Contributor Author

Here's the output while updating package-lock.json:

~/_code/hfg-gmuend/openmoji 🌿 npm install
npm warn old lockfile
npm warn old lockfile The package-lock.json file was created with an old version of npm,
npm warn old lockfile so supplemental metadata must be fetched from the registry.
npm warn old lockfile
npm warn old lockfile This is a one-time fix-up, please be patient...
npm warn old lockfile
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm warn deprecated [email protected]: this library is no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Use your platform's native DOMException instead
npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
npm warn deprecated [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
npm warn deprecated
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated [email protected]: Please upgrade to 2.3.7 which fixes GHSA-4q6p-r6v2-jvc5
npm warn deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.

added 330 packages, and audited 331 packages in 43s

56 packages are looking for funding
  run `npm fund` for details

21 vulnerabilities (8 moderate, 10 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
~/_code/hfg-gmuend/openmoji 🌿

@kili-ilo
Copy link
Contributor Author

npm test now passes! 🤷🏻‍♀️

~/_code/hfg-gmuend/openmoji 🌿 npm test

> [email protected] test
> mocha --parallel --reporter min test/*.{js,mjs} --openmoji-data-jso
n $PWD/data/openmoji.json --openmoji-src-folder $PWD/src

[...]

  82778 passing (33s)

~/_code/hfg-gmuend/openmoji 🌿

@kili-ilo
Copy link
Contributor Author

CC @b-g

@b-g
Copy link
Member

b-g commented Apr 23, 2025

Hi @kili-ilo, many many thanks for tackling this. However, besides the test it would be important to check:

  • npm run generate: Delete before running all derived assets in /black/* and /color/*. Add some non snese line break in a few svg source files ... is the openmoji svg source file format enforced after running "generate"?
  • npm run generate-fonts: make sure that docker is running in background
  • are all the little helpers working?
  • npm test

Could you please double check the things above? Sorry to bother ... but node v22 would be mega, but I'm very hesitant to change the current working system. I hope you understand.

@kili-ilo
Copy link
Contributor Author

I totally understand! I'm happy to super-test this like that. I'm afk this week, so I can do those next week.

@kili-ilo
Copy link
Contributor Author

kili-ilo commented Apr 29, 2025

  • npm run generate
    • Runs smoothly
    • SVGs:
      • Modifies every exported SVG with no-op changes (whitespace, /> vs. ></), perhaps due to some formatting change in a JS dependency (since I see no SVG export diffs on master)
      • I've added a helpers/pretty-exported-svg.sh helper script to eliminate those discrepancies from git diffs. It takes a very long time to run (on my machine, like all of the export/generate scripts too), so I'm happy to remove it if you'd prefer to just manually ignore these touches after every export.
    • PNGs:
      • Modifies every exported PNG with no-op changes (I can't tell what they are - images look identical), but this also happens for me on master - I infer that this is an existing problem and that you prefer to just manually ignore these touches after every export.
  • npm run generate-fonts
    • Runs smoothly
  • all the little helpers
    • all those that are called by the generate script run smoothly
      • helpers/find-emojis.js
      • helpers/generate-data-tables.js
      • helpers/generate-index-html.js
      • helpers/generate-index-list-html.js
      • helpers/pretty-src-svg.js
    • ./helpers/force-color-palette-svg.js runs smoothly
    • I think that's enough of a sample size to consider them happy, but let me know if you'd like a complete inventory.
  • npm test
    • still green

FWIW, here are recordings of me working on the above tests (too long, don't watch all, haha):

(expired, not worth re-posting)

@b-g
Copy link
Member

b-g commented May 7, 2025

Hi @kili-ilo, many thanks for this great gift! This is super! Just I'm hyper busy the next 2 weeks and don't have time to test this in detail. Sorry! Will look into it asap after. Stay tuned. All the best.

@kili-ilo
Copy link
Contributor Author

kili-ilo commented May 7, 2025

No problem, I'm not blocked by this. Take your time!

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.

Update nodejs version
2 participants