I've updated the required NodeJS version to v20 from v19
When attempting to run yarn with v19, I get the following error:
yarn install v1.22.22
warning ../../../package.json: No license field
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error node-addon-api@7.1.0: The engine "node" is incompatible with this module. Expected version "^16 || ^18 || >= 20". Got "19.9.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Upgrading to v20 fixes the error
I updated the package.jsonstart script command because the existing command was giving me the error:
yarn run v1.22.22
warning ../../../package.json: No license field
$ ts-node-esm src/index.ts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/whyit/tmp/developer-guides-code/decrypt-api-key-in-action/src/index.ts
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
at defaultLoad (node:internal/modules/esm/load:143:22)
at async nextLoad (node:internal/modules/esm/hooks:865:22)
at async nextLoad (node:internal/modules/esm/hooks:865:22)
at async Hooks.load (node:internal/modules/esm/hooks:448:20)
at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
v20
fromv19
When attempting to runyarn
withv19
, I get the following error:Upgrading to
v20
fixes the errorpackage.json
start
script command because the existing command was giving me the error: