Skip to content

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

Closed

Description

@benz0li

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 5cdfe74

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:

Activity

  1. added
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Jan 28, 2022
  2. benz0li commented on Jan 28, 2022

    @benz0li
    ContributorAuthor

    @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?

  3. foxfire881 commented on Jan 28, 2022

    @foxfire881

    i also got these errors in 4.0.2.

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

  4. RobertCNelson commented on Jan 28, 2022

    @RobertCNelson

    Also the armhf build..

    app/node_modules/@node-rs/argon2/index.js:201
        throw loadError
        ^
    
    Error: Cannot find module '@node-rs/argon2-linux-arm-gnueabihf'
    Require stack:
    
  5. ljishen commented on Jan 28, 2022

    @ljishen

    I have the same problem with the v4.0.2 docker image.

  6. code-asher commented on Jan 28, 2022

    @code-asher
    Member
  7. code-asher commented on Jan 28, 2022

    @code-asher
    Member

    I am not sure how this works actually. The argon2 module has a bunch of optional dependencies for the various per-platform builds (@node-rs/argon2-win32-x64-msvc for example). Does Node only download optional dependencies if they match the current platform? If so why does it download the wrong ones? We set NODE_CONFIG_ARCH but maybe that is not enough.

  8. ljishen commented on Jan 28, 2022

    @ljishen

    @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.

  9. jsjoeio commented on Jan 28, 2022

    @jsjoeio
    Contributor

    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.

  10. benz0li commented on Jan 29, 2022

    @benz0li
    ContributorAuthor

    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.

    @ljishen With this workaround I can build the docker image. But then, the following comes up when running the container:

    [...]
    
    [IPC Library: File Watcher (parcel, node.js)] Loading "@parcel/watcher" failed
    [IPC Library: File Watcher (parcel, node.js)] Error: No native build was found for platform=linux arch=arm64 runtime=node abi=83 uv=1 armv=8 libc=glibc node=14.17.4
        loaded from: /opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher
    
        at Function.load.path (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:59:9)
        at load (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:21:30)
        at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/index.js:1:42)
        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)
        at require (internal/modules/cjs/helpers.js:92:18)
        at r (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:101)
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1723)
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695)
        at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300)
        at Object.errorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10421)
        at e.triggerErrorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:11059)
        at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10765
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1740)
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695)
        at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300)
        at i._loadModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10430)
        at i._resolve (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:452)
        at i.defineModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:6142)
        at v (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:1702)
        at g (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2557)
        at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:22221)
        at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:30915)
        at e._createAndEvalScript (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2601)
        at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2240
        at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:73:3)
    [IPC Library: File Watcher (parcel, node.js)] Here are the modules that depend on it:
    [IPC Library: File Watcher (parcel, node.js)]% [ 'vs/platform/files/node/watcher/parcel/parcelWatcherService' ]
    
    [...]
    

    👉 Directory /opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/build in code-server-4.0.2-linux-arm64.tar.gz is missing.

    Bottom line: I'm skipping code-server v4.0.2.

  11. ljishen commented on Jan 30, 2022

    @ljishen

    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.

    @ljishen With this workaround I can build the docker image. But then, the following comes up when running the container:

    [...]
    
    [IPC Library: File Watcher (parcel, node.js)] Loading "@parcel/watcher" failed
    [IPC Library: File Watcher (parcel, node.js)] Error: No native build was found for platform=linux arch=arm64 runtime=node abi=83 uv=1 armv=8 libc=glibc node=14.17.4
        loaded from: /opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher
    
        at Function.load.path (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:59:9)
        at load (/opt/code-server/vendor/modules/code-oss-dev/node_modules/node-gyp-build/index.js:21:30)
        at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/index.js:1:42)
        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)
        at require (internal/modules/cjs/helpers.js:92:18)
        at r (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:101)
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1723)
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695)
        at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300)
        at Object.errorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10421)
        at e.triggerErrorback (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:11059)
        at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10765
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:1740)
        at e.load (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:3:10695)
        at d (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10300)
        at i._loadModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:10430)
        at i._resolve (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:452)
        at i.defineModule (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:5:6142)
        at v (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:6:1702)
        at g (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2557)
        at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:22221)
        at Object.<anonymous> (/opt/code-server/vendor/modules/code-oss-dev/out/vs/platform/files/node/watcher/parcel/watcherApp.js:12:30915)
        at e._createAndEvalScript (/opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2601)
        at /opt/code-server/vendor/modules/code-oss-dev/out/vs/loader.js:4:2240
        at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:73:3)
    [IPC Library: File Watcher (parcel, node.js)] Here are the modules that depend on it:
    [IPC Library: File Watcher (parcel, node.js)]% [ 'vs/platform/files/node/watcher/parcel/parcelWatcherService' ]
    
    [...]
    

    👉 Directory /opt/code-server/vendor/modules/code-oss-dev/node_modules/@parcel/watcher/build in code-server-4.0.2-linux-arm64.tar.gz is missing.

    Bottom line: I'm skipping code-server v4.0.2.

    I didn't build the image. I used the latest one from here https://hub.docker.com/r/codercom/code-server/tags
    To run a container, I changed the entrypoint to bash, then I can do the change I mentioned. Finally, I ran the original entrypoint /usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 . under dir /home/coder. This is what I see under that dir inside the container

    $ ls /usr/lib/code-server/node_modules/@node-rs/argon2-linux-arm64-gnu
    argon2.linux-arm64-gnu.node  package.json  README.md
  12. M12mm4 commented on Jan 30, 2022

    @M12mm4

    I have the same problem

    I am using Ubuntu 21.10 on my phone installed via proot-distoro how can I fix it ?

  13. werdnum commented on Jan 30, 2022

    @werdnum

    FWIW, this appears to be the offending commit: 723469a

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

  14. 18 remaining items

  15. code-asher commented on Feb 16, 2022

    @code-asher
    Member

    Haha I completely spaced that we use yarn not npm.

  16. added a commit that references this issue on Feb 17, 2022
  17. YueMiyuki commented on Feb 24, 2022

    @YueMiyuki

    Same thing happened here today
    I am no raspberry pi 4

  18. jsjoeio commented on Feb 24, 2022

    @jsjoeio
    Contributor

    @ItzMiracleOwO please wait for the next release!

  19. lg-nineoneninethreenine commented on Feb 26, 2022

    @lg-nineoneninethreenine
    Contributor

    What's the glitch?

  20. YueMiyuki commented on Feb 26, 2022

    @YueMiyuki

    What's the glitch?

    wdym?

  21. M12mm4 commented on Feb 26, 2022

    @M12mm4

    You can just run this commands
    cd /usr/lib/code-server
    npm install @node-rs/argon2-linux-arm64-gnu

  22. JWhiteUX commented on Feb 27, 2022

    @JWhiteUX

    Same for me.

    picode@raspberrypi:~ $ code-server
    /usr/lib/code-server/node_modules/@node-rs/argon2/index.js:201
        throw loadError
        ^
    
    Error: Cannot find module '@node-rs/argon2-linux-arm64-gnu'
    Require stack:
    - /usr/lib/code-server/node_modules/@node-rs/argon2/index.js
    - /usr/lib/code-server/out/node/util.js
    - /usr/lib/code-server/out/node/cli.js
    - /usr/lib/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> (/usr/lib/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: [
        '/usr/lib/code-server/node_modules/@node-rs/argon2/index.js',
        '/usr/lib/code-server/out/node/util.js',
        '/usr/lib/code-server/out/node/cli.js',
        '/usr/lib/code-server/out/node/entry.js'
      ]
    }
    
  23. JWhiteUX commented on Feb 27, 2022

    @JWhiteUX

    You can just run this commands cd /usr/lib/code-server npm install @node-rs/argon2-linux-arm64-gnu

    This just threw a ton of errors.

    2028 warn EBADENGINE Unsupported engine {
    2028 warn EBADENGINE   package: 'code-server@4.0.2',
    2028 warn EBADENGINE   required: { node: '>= 14' },
    2028 warn EBADENGINE   current: { node: 'v12.22.5', npm: '7.5.2' }
    2028 warn EBADENGINE }
    
    
    2044 error code EACCES
    2045 error syscall rename
    2046 error path /usr/lib/code-server/node_modules/escodegen/node_modules/deep-is
    2047 error dest /usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg
    2048 error errno -13
    2049 error Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'
    2049 error  [Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'] {
    2049 error   errno: -13,
    2049 error   code: 'EACCES',
    2049 error   syscall: 'rename',
    2049 error   path: '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is',
    2049 error   dest: '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'
    2049 error }
    2050 error The operation was rejected by your operating system.
    2050 error It is likely you do not have the permissions to access this file as the current user
    2050 error
    2050 error If you believe this might be a permissions issue, please double-check the
    2050 error permissions of the file and its containing directories, or try running
    2050 error the command again as root/Administrator.
    
  24. YueMiyuki commented on Feb 27, 2022

    @YueMiyuki

    You can just run this commands cd /usr/lib/code-server npm install @node-rs/argon2-linux-arm64-gnu

    This just threw a ton of errors.

    2028 warn EBADENGINE Unsupported engine {
    2028 warn EBADENGINE   package: 'code-server@4.0.2',
    2028 warn EBADENGINE   required: { node: '>= 14' },
    2028 warn EBADENGINE   current: { node: 'v12.22.5', npm: '7.5.2' }
    2028 warn EBADENGINE }
    
    
    2044 error code EACCES
    2045 error syscall rename
    2046 error path /usr/lib/code-server/node_modules/escodegen/node_modules/deep-is
    2047 error dest /usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg
    2048 error errno -13
    2049 error Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'
    2049 error  [Error: EACCES: permission denied, rename '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is' -> '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'] {
    2049 error   errno: -13,
    2049 error   code: 'EACCES',
    2049 error   syscall: 'rename',
    2049 error   path: '/usr/lib/code-server/node_modules/escodegen/node_modules/deep-is',
    2049 error   dest: '/usr/lib/code-server/node_modules/escodegen/node_modules/.deep-is-UvyPHfCg'
    2049 error }
    2050 error The operation was rejected by your operating system.
    2050 error It is likely you do not have the permissions to access this file as the current user
    2050 error
    2050 error If you believe this might be a permissions issue, please double-check the
    2050 error permissions of the file and its containing directories, or try running
    2050 error the command again as root/Administrator.
    

    u need sudo
    and ur node version is lower the required version

  25. YueMiyuki commented on Feb 27, 2022

    @YueMiyuki

    Screenshot_2022-02-27-18-07-03-937_com.opera.browser.jpgScreenshot_2022-02-27-18-07-51-458_com.termux.jpg

    Actully I tried to manually install the module but it return 404

  26. M12mm4 commented on Feb 27, 2022

    @M12mm4

    If It requires Root administration make sure you are in a super user privileges or as root
    You can search on google how to add superuser privilege in your Linux distribution

  27. Brooooooklyn commented on Sep 18, 2023

    @Brooooooklyn

    @jsjoeio you can consider switch back to @node-rs/argon2 again since npm/cli#6755 landed

  28. jsjoeio commented on Sep 22, 2023

    @jsjoeio
    Contributor

    @Brooooooklyn That's amazing! I'm not involved in the project anymore but maybe someone else from the team/community can. Thanks for flagging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghigh-priorityThis issue needs to be resolved ASAPtriageThis issue needs to be triaged by a maintainer

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions