retro-env-can-weather-chan
retro-env-can-weather-chan copied to clipboard
Fails to run on latest node 18 (18.19)
Issue
Does not run on the latest version of node 18 (18.19).
Repo
Attempt to run via a docker container using the below:
# Toggle node version here - node:18 becomes 18.19, which does not work. 18.18 does work.
FROM node:18-slim
EXPOSE 8600
WORKDIR /root/envcan
RUN apt update && apt install git -y
RUN git clone https://github.com/Forceh91/retro-env-can-weather-chan ./
RUN yarn install
RUN yarn build:display
ENTRYPOINT [ "yarn", "start" ]
Paste the above into a new Dockerfile
in a new directory, then run docker build . --tag envcan && docker run -it envcan
Runs fine on node 18.18, but node 18.19 triggers the following:
yarn run v1.22.19
$ tsx src/server.ts
node:internal/process/esm_loader:40
internalBinding('errors').triggerUncaughtException(
^
Error: tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0
at X (file:///root/envcan/node_modules/tsx/dist/esm/index.mjs:1:1920)
at Hooks.addCustomLoader (node:internal/modules/esm/hooks:202:24)
at Hooks.register (node:internal/modules/esm/hooks:168:16)
at async initializeHooks (node:internal/modules/esm/utils:167:5)
at async customizedModuleWorker (node:internal/modules/esm/worker:104:24)
Node.js v18.19.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected Results
The readme file says the project should run on node 18 and above, but does not currently run on the latest node 18 (18.19).
node:20-slim
does work, so perhaps the solution is to bump the supported node version?
Interesting... I persumed the GitHub pipelines that run on Node 18.x were using the latest. The tsx error message about deprecation makes no sense as 18.9 is before 20.6 afaik?
The --loader flag was deprecated in Node v20.6.0