code-server: [Bug]: Cannot find module '@node-rs/argon2-linux-arm64-gnu'

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Firefox 96.0.3 (64-bit)
  • Local OS: macOS 10.14.6 (Mojave)
  • Remote OS: Debian bullseye
  • Remote Architecture: aarch64
  • code-server --version: code-server 4.0.2 5cdfe74686aa73e023f8354a9a6014eb30caa7dd

Steps to Reproduce

  1. git clone https://gitlab.b-data.ch/jupyterlab/julia/docker-stack.git
  2. cd docker-stack/ver
  3. docker build -t julia-ver -f latest.Dockerfile .

Expected

Successful build

Actual

https://gitlab.b-data.ch/jupyterlab/r/r-ver/-/jobs/20883

Logs

[...]

Error: Cannot find module '@node-rs/argon2-linux-arm64-gnu'
Require stack:
- /opt/code-server/node_modules/@node-rs/argon2/index.js
- /opt/code-server/out/node/util.js
- /opt/code-server/out/node/cli.js
- /opt/code-server/out/node/entry.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/opt/code-server/node_modules/@node-rs/argon2/index.js:172:31)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/code-server/node_modules/@node-rs/argon2/index.js',
    '/opt/code-server/out/node/util.js',
    '/opt/code-server/out/node/cli.js',
    '/opt/code-server/out/node/entry.js'
  ]
}

[...]

Screenshot/Video

No response

Does this issue happen in VS Code?

  • I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

Related issues:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 36 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I found a Temporary solution for this problem.

  1. I have uninstalled the script I installed using sudo apt remove code-server
  2. I downloaded the 3.12.0 instead . I found it much better and more stable than any of the 4.0.x versions Note : I am note a heavy user most of the time I am doing data analysis/ machine learning via google colab so I only use code server for other programming stuff like c , c++ , java , JavaScript programming

@code-asher Directories in ./node_modules/@node-rs of code-server-4.0.2-linux-arm64.tar.gz:

argon2
argon2-linux-x64-gnu
argon2-linux-x64-musl

Why are there argon2-linux-x64-gnu and argon2-linux-x64-musl instead of argon2-linux-arm64-gnu?

Thanks for mentioning this. I can temporarily fix it by manually downloading https://registry.yarnpkg.com/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.0.5.tgz and put it into /usr/lib/code-server/node_modules/@node-rs/argon2-linux-arm64-gnu.

Haha I completely spaced that we use yarn not npm.

npm_config_build_from_source might work! You might need Rust and Cargo installed. I looked more into optionalDependencies but I did not see anything in the docs about it only downloading some of them based on platform.

FWIW, this appears to be the offending commit: https://github.com/coder/code-server/commit/723469ab5bed3ba9fbb3e8d5ecbfcd9a3bee2d88

I’ve solved it for myself by running 4.0.1, which doesn’t seem to have that problem.

@jsjoeio you can consider switch back to @node-rs/argon2 again since https://github.com/npm/cli/pull/6755 landed

Root cause seems to be this: https://github.com/npm/arborist/pull/231

Optional dependencies are only downloaded for the current platform rather than the target platform.

Long-term solution probably involves modifying that behavior in npm to use the target platform instead but in the meantime revert seems like the way to go.

Hmm maybe there is something wrong with the cross-compilation step. It sets some variables that seem related to gcc…maybe we need something similar for Rust.

Let me ping the node-rs team (they were super helpful when we made the migration).

cc @Brooooooklyn @yisibl - is there anything obvious we might have missed in the migration? Otherwise, I’ll see if I can dig in and see where this is coming form.

i also got these errors in 4.0.2.

too many bugs after version 4.0, i have downgrade my code-server to3.12.