subql icon indicating copy to clipboard operation
subql copied to clipboard

Install is broken

Open n13 opened this issue 8 months ago • 1 comments

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

n13 avatar Apr 25 '25 02:04 n13

I updated node to v22 and update @subql/cli to latest version and it helped

PimpMyDapp avatar Apr 27 '25 06:04 PimpMyDapp

This was fixed in https://github.com/subquery/subql/pull/2774

stwiname avatar May 11 '25 20:05 stwiname