Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
benz0li opened this issue Jan 28, 2022 · 36 comments · Fixed by #4829
Closed
3 tasks done

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

benz0li opened this issue Jan 28, 2022 · 36 comments · Fixed by #4829
Assignees
Labels
bug Something isn't working high-priority This issue needs to be resolved ASAP triage This issue needs to be triaged by a maintainer
Milestone

Comments

@benz0li
Copy link
Contributor

benz0li commented Jan 28, 2022

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:

@benz0li benz0li added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Jan 28, 2022
@benz0li
Copy link
Contributor Author

benz0li commented Jan 28, 2022

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

@foxfire881
Copy link

i also got these errors in 4.0.2.

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

@RobertCNelson
Copy link

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:

@ljishen
Copy link

ljishen commented Jan 28, 2022

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

@code-asher
Copy link
Member

code-asher commented Jan 28, 2022 via email

@code-asher
Copy link
Member

code-asher commented Jan 28, 2022

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.

@ljishen
Copy link

ljishen commented Jan 28, 2022

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

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 28, 2022

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.

@benz0li
Copy link
Contributor Author

benz0li commented Jan 29, 2022

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.

@ljishen
Copy link

ljishen commented Jan 30, 2022

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

@M12mm4
Copy link

M12mm4 commented Jan 30, 2022

I have the same problem

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

@werdnum
Copy link

werdnum commented Jan 30, 2022

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.

haraldkoch pushed a commit to haraldkoch/kochhaus-home that referenced this issue Jan 30, 2022
@jsjoeio jsjoeio added the high-priority This issue needs to be resolved ASAP label Jan 31, 2022
@jsjoeio jsjoeio added this to the 4.0.3 milestone Jan 31, 2022
@jsjoeio jsjoeio self-assigned this Feb 1, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 3, 2022

In https://github.com/coder/code-server/pull/4733/files, I removed this:

# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
export npm_config_build_from_source=true

I wonder if adding it back in would fix this.

I'm going to start working on this soon and will post my notes as I investigate. Thank you all for chiming in! Apologies for the issues.

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 3, 2022

Investigation Notes

These are the notes as I investigate. I'll update this comment as not to spam this thread.

Reproducing

❌ Can't reproduce with issue reproduction steps

Could not reproduce with @benz0li's steps (I think they reverted back to 4.0.1).

image

❌ Can't reproduce with code-server@beta npm package

I tried using a Coder workspace with Ubuntu/Node and following these steps:

  1. Set up Coder workspace with joe-image (has Node v14, yarn, Rust, etc)
  2. yarn init -y
  3. yarn add code-server@beta (see if it still exists on latest main, link)

The installation works just fine. And I'm able to run code-server.

image

❌ Can't reproduce with Docker locally on macOS + Brave

  1. Run locally:
docker run -it --name code-server -p 127.0.0.1:8080:8080 \
  -v "$HOME/.config:/home/coder/.config" \
  -v "$PWD:/home/coder/project" \
  -u "$(id -u):$(id -g)" \
  -e "DOCKER_USER=$USER" \
  codercom/code-server:latest
  1. Access code-server via localhost:8080

Solution Ideas

Maybe using npm_config_build_from_source=true and having Rust/Cargo in CI

Workaround

TODO revisit workaround

Read about npm_config_build_from_source

It's weird...I can't find any docs on this 🤔 And there isn't much coming up in DDG.

It doesn't appear that napi-rs supports this yet based on this issue: napi-rs/napi-rs#447

So unfortunately I don't think that will work.

@code-asher
Copy link
Member

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.

@M12mm4
Copy link

M12mm4 commented Feb 4, 2022

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

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 4, 2022

@ljishen could you provide repro steps by chance? I tried using the 4.0.2 Docker image (on macOS) but couldn't reproduce this.

@M12mm4
Copy link

M12mm4 commented Feb 4, 2022

  1. sudo apt remove code-server
  2. choose a type from here then wget (url chosen)
  3. unpack the file it depends on your system for me it was arm64

Note: I am using Ubuntu 21.10

@ljishen
Copy link

ljishen commented Feb 4, 2022

@ljishen could you provide repro steps by chance? I tried using the 4.0.2 Docker image (on macOS) but couldn't reproduce this.

I think this problem is specific to arm64 machines. So maybe you try on one of those machines.

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 4, 2022

I think this problem is specific to arm64 machines. So maybe you try on one of those machines.

Ah, figured so. I don't have one sadly but currently trying to emulate one with QEMU. Not having much luck unfortunately.

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 4, 2022

Okay @code-asher and I have gone down quite the rabbit hole. I'll try my best to summarize what we know. We added @node-rs/argon2 to replace node-argon2 so that code-server would work on environments like Termux. Unfortunately something broke with our cross-compilation step leading to this bug. We can't get node-rs to install the correct prebuilt binaries.

There doesn't appear to any solutions to our problem so the only option we have left is to revert 723469a

@code-asher
Copy link
Member

code-asher commented Feb 4, 2022

Root cause seems to be this: npm/arborist#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.

jsjoeio added a commit that referenced this issue Feb 4, 2022
This reverts part of the changes introduced in refactor: migrate from argon2 ->
@node-rs/argon2 (#4733)

Switching to @node-rs/argon2 introduced bugs that we couldn't solve due to
limitations in npm.

see here
#4804 (comment)
jsjoeio added a commit that referenced this issue Feb 4, 2022
* revert: partial revert of 723469a

This reverts part of the changes introduced in refactor: migrate from argon2 ->
@node-rs/argon2 (#4733)

Switching to @node-rs/argon2 introduced bugs that we couldn't solve due to
limitations in npm.

see here
#4804 (comment)
@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 10, 2022

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

It appears there are workarounds.

But yarn 1.x has a workaround for this scenario, you can use --ignore-platform flag to let yarn install all the platform binaries for you. And yarn 2+ here is supportedArchitectures for this case.

Source

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.

Looks like there is an open RFC discussing package distributions which might address some of these issues.

vaskozl added a commit to vaskozl/home-infra that referenced this issue Feb 10, 2022
It doesn't work on arm64 coder/code-server#4804

I don't use it enough
@code-asher
Copy link
Member

Haha I completely spaced that we use yarn not npm.

billimek referenced this issue in billimek/k8s-gitops Feb 17, 2022
Signed-off-by: Jeff Billimek <jeff@billimek.com>
@ItzMiracleOwO
Copy link

Same thing happened here today
I am no raspberry pi 4

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 24, 2022

@ItzMiracleOwO please wait for the next release!

@im-coder-lg
Copy link
Contributor

What's the glitch?

@ItzMiracleOwO
Copy link

What's the glitch?

wdym?

@M12mm4
Copy link

M12mm4 commented Feb 26, 2022

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

@JWhiteUX
Copy link

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'
  ]
}

@JWhiteUX
Copy link

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.

@ItzMiracleOwO
Copy link

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

@ItzMiracleOwO
Copy link

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

@M12mm4
Copy link

M12mm4 commented Feb 27, 2022

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

@benz0li benz0li mentioned this issue Mar 4, 2022
4 tasks
TinLe pushed a commit to TinLe/code-server that referenced this issue Apr 23, 2022
* revert: partial revert of 723469a

This reverts part of the changes introduced in refactor: migrate from argon2 ->
@node-rs/argon2 (coder#4733)

Switching to @node-rs/argon2 introduced bugs that we couldn't solve due to
limitations in npm.

see here
coder#4804 (comment)
@Brooooooklyn
Copy link

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

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 22, 2023

@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
Labels
bug Something isn't working high-priority This issue needs to be resolved ASAP triage This issue needs to be triaged by a maintainer
Projects
None yet