subsquid / squid-cli

CLI for managing squid deployments to the SQD Cloud
17 stars 16 forks source link

Install error #74

Closed thanhlmm closed 6 months ago

thanhlmm commented 6 months ago

When I run

npm i -g @subsquid/cli@latest

It returns error

npm ERR! code 1
npm ERR! path /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cli
npm ERR! command failed
npm ERR! command sh -c -- node ./bin/run.js autocomplete --refresh-cache
npm ERR! ›   ModuleLoadError: [MODULE_NOT_FOUND] require failed to load /Users/thanhle/
npm ERR!  ›   .nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cli/lib/commands: 
npm ERR!  ›   Cannot find module '/Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_mo
npm ERR!  ›   dules/@subsquid/cli/lib/commands'
npm ERR!  ›   Require stack:
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/node_modules/@oclif/core/lib/module-loader.js
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/node_modules/@oclif/core/lib/help/index.js
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/node_modules/@oclif/core/lib/flags.js
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/node_modules/@oclif/core/lib/cli-ux/styled/table.js
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/node_modules/@oclif/core/lib/cli-ux/styled/index.js
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/node_modules/@oclif/core/lib/cli-ux/index.js
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/node_modules/@oclif/core/lib/index.js
npm ERR!  ›   - /Users/thanhle/.nvm/versions/node/v16.20.2/lib/node_modules/@subsquid/cl
npm ERR!  ›   i/bin/run.js
npm ERR!  ›   Code: MODULE_NOT_FOUND
belopash commented 6 months ago

What is your setup? WSL?

mlenser commented 6 months ago

I have the same issue locally on windows and all of my CI (Linux) experience the same issue. I've tried installing it normally with pnpm, I've tried installing it globally with npm, yarn, and pnpm. Nothing works.

It started yesterday on CI.

Example error (yarn on linux in this case):

Run yarn global add @subsquid/cli@latest
yarn global v1.22.21
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /home/runner/.config/yarn/global/node_modules/@subsquid/cli: Command failed.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
Exit code: 1
Command: node ./bin/run.js autocomplete --refresh-cache
Arguments: 
Directory: /home/runner/.config/yarn/global/node_modules/@subsquid/cli
Output:
›   ModuleLoadError: [MODULE_NOT_FOUND] require failed to load 
 ›   /home/runner/.config/yarn/global/node_modules/@subsquid/cli/lib/commands: 
 ›   Cannot find module 
 ›   '/home/runner/.config/yarn/global/node_modules/@subsquid/cli/lib/commands'
 ›   Require stack:
 ›   - /home/runner/.config/yarn/global/node_modules/@oclif/core/lib/module-loa
 ›   der.js
 ›   - /home/runner/.config/yarn/global/node_modules/@oclif/core/lib/help/index
 ›   .js
 ›   - /home/runner/.config/yarn/global/node_modules/@oclif/core/lib/flags.js
 ›   - /home/runner/.config/yarn/global/node_modules/@oclif/core/lib/cli-ux/sty
 ›   led/table.js
 ›   - /home/runner/.config/yarn/global/node_modules/@oclif/core/lib/cli-ux/sty
 ›   led/index.js
 ›   - /home/runner/.config/yarn/global/node_modules/@oclif/core/lib/cli-ux/ind
 ›   ex.js
 ›   - /home/runner/.config/yarn/global/node_modules/@oclif/core/lib/index.js
 ›   - /home/runner/.config/yarn/global/node_modules/@subsquid/cli/bin/run.js
 ›   Code: MODULE_NOT_FOUND
thanhlmm commented 6 months ago

MacOS. The root cause of @oclif/core new version

mlenser commented 6 months ago

The root cause of @oclif/core new version

If this is saying that @oclif/core is the root cause: I'm not sure. I resolved it to 3.20.0 (last week) and the issue still persists.

thanhlmm commented 6 months ago

The root cause of @oclif/core new version

If this is saying that @oclif/core is the root cause: I'm not sure. I resolved it to 3.20.0 (last week) and the issue still persists.

3.19.1 will work bro

belopash commented 6 months ago

Should be resolved in subsquid/cli@2.8.7. We locked oclif version for now.

mlenser commented 6 months ago

I can confirm the issue is resolved via subsquid/cli@2.8.7. Thank you for the quick turnaround!