jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI
Other
1.5k stars 283 forks source link

@gitbeaker/cli does not work on Node 22 #3591

Closed kashz closed 1 month ago

kashz commented 1 month ago

Description

$ gitbeaker --version
file:///Users/xxx/.asdf/installs/nodejs/22.2.0/lib/node_modules/@gitbeaker/cli/dist/index.mjs:5
import API_MAP from '@gitbeaker/core/map.json' assert { type: 'json' };
                                               ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:337:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:163:18)
    at callTranslator (node:internal/modules/esm/loader:430:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:436:30)
    at async ModuleJob._link (node:internal/modules/esm/module_job:106:19)

Node.js v22.2.0

I've encountered an issue where @gitbeaker/cli does not work with Node 22. This is because the assert keyword has been removed in Node 22.

https://github.com/nodejs/node/pull/52104

Replacing it with the with keyword should resolve the issue, but the with keyword does not work on Node versions less than 18.20.0, which may affect the supported Node versions.

Checklist

jdalrymple commented 1 month ago

Shouldnt be a problem since the libs lowest version is 18!