subql
subql copied to clipboard
Install is broken
Description
Followed the install steps from zero from the website, got this error
> npm install -g @subql/cli
... (install succeeds)
> subql --help
/Users/elohim/.nvm/versions/node/v20.5.0/lib/node_modules/@subql/cli/bin/run:6
const boxen = require('boxen');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/elohim/.nvm/versions/node/v20.5.0/lib/node_modules/@subql/cli/node_modules/boxen/index.js from /Users/elohim/.nvm/versions/node/v20.5.0/lib/node_modules/@subql/cli/bin/run not supported.
Instead change the require of index.js in /Users/elohim/.nvm/versions/node/v20.5.0/lib/node_modules/@subql/cli/bin/run to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/elohim/.nvm/versions/node/v20.5.0/lib/node_modules/@subql/cli/bin/run:6:15) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v20.5.0
Fix
Submitted PR with fix here:
https://github.com/subquery/subql/pull/2764
I updated node to v22 and update @subql/cli to latest version and it helped
This was fixed in https://github.com/subquery/subql/pull/2774