npx --yes gitlab-ci-local@latest
file:///Users/username/.npm/_npx/3f18f2096def1b34/node_modules/gitlab-ci-local/src/index.js:13
import packageJson from "../package.json" with { type: "json" };
^^^^
SyntaxError: Unexpected token 'with'
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
at async link (node:internal/modules/esm/module_job:68:21)
Node.js v18.18.2
This PR fixes the issue by converting json imports to instead use readfilesync and JSON.parse instead, which makes it more explicit and avoids this error.
This fix allows users who may otherwise not be able to update to Node v18.20 overnight to continue using this tool.
Reopening of #1422
In Node 18.18, the following error occurs:
This PR fixes the issue by converting json imports to instead use readfilesync and JSON.parse instead, which makes it more explicit and avoids this error.
This fix allows users who may otherwise not be able to update to Node v18.20 overnight to continue using this tool.
Thanks again!