Support current Node LTS version
Summary
When using any version of node 22.x and greater CyberChef errors because of a breaking change to Node starting with version 22. Node switched to using import attributes and assert needs to be swapped to the with syntax.
https://nodejs.org/docs/latest-v22.x/api/esm.html#import-attributes
Example Output
file:///srv/src/core/Recipe.mjs:7
import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
^^^^^^
SyntaxError: Unexpected identifier 'assert'
at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:106:18)
at #translate (node:internal/modules/esm/loader:470:12)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:517:27)
nodejs 18 is EOL:
- End of Active Support: 18 Oct 2023
- End of Security Support: 30 Apr 2025
EoL:
- https://nodejs.org/en/about/previous-releases
- https://endoflife.date/nodejs
Please support nodeJS 24 LTS
ok, first of all the versions of some packages are way too old
second, assert {type: "json"} is now invalid syntax for imports
some flags such as --no-experimental-fetch and --experimental-json-modules are useless now
also some packages say they are only tested for node 13, and also other old packages have security vulns that aren't fixable
yeah this would need some work