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

Android: UserLAnd code-server docs causing error #6731

Open
1 task done
haruki-py opened this issue Mar 27, 2024 · 9 comments
Open
1 task done

Android: UserLAnd code-server docs causing error #6731

haruki-py opened this issue Mar 27, 2024 · 9 comments
Labels
bug Something isn't working os-android Android/Termux related triage This issue needs to be triaged by a maintainer

Comments

@haruki-py
Copy link

haruki-py commented Mar 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Android
  • Remote OS: Ubuntu
  • Remote Architecture: amd64 I think
  • code-server --version: Didnt get it to work yet

Steps to Reproduce

  1. sudo apt update -y
  2. sudo apt install nodejs npm curl -y
  3. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
  4. nvm install 18
  5. nvm use 18
  6. npm install --global code-server --unsafe-perm
  7. code-server
  8. npm i argon2
  9. code-server (same result as 7.)
  10. npm i -g argon2
  11. code-server (same result as 7.)
  12. npm i -g --unsafe-perm argon2
  13. code-server (same result as 7.)
    Still module not found error

Expected

Similar to this:
[2024-03-16T18:46:44.789Z] info - Using certificate for HTTPS: /home/container/.local/share/code-server/localhost.crt [2024-03-16T18:46:44.789Z] info Session server listening on /home/container/.local/share/code-server/code-server-ipc.sock [18:58:25]

Actual

node:internal/modules/cjs/loader:1143

  throw err;
  ^

Error: Cannot find module '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2/lib/binding/napi-v3/argon2.node'
Require stack:
- /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2/argon2.js
- /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/out/node/util.js
- /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/out/node/cli.js
- /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/out/node/entry.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Module._load (node:internal/modules/cjs/loader:981:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2/argon2.js:9:25)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2/argon2.js',
    '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/out/node/util.js',
    '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/out/node/cli.js',
    '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/out/node/entry.js'
  ]
}

Node.js v18.20.0

Logs

Same output in Actual with verbose flag.
Installations log in the screenshot and the first second of first video

Screenshot/Video

After installing nvm:
image
Screen record starting from installation of codeserver (Other things done correctly as said above:

WhatsApp.Video.2024-03-27.at.8.48.16.PM.mp4

Continuation of recording:

WhatsApp.Video.2024-03-27.at.8.48.13.PM.mp4

Does this bug reproduce in native VS Code?

This cannot be tested in native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

I wasn't able to run the code server and the default one is http but I don't think it affected the bug so I removed it.

Notes

  • I first did sudo apt update -y and then as per told in the UserLAnd installation guidelines in the docs
  • I saw the error was module not found so I tried installing argon2 many times many ways but still the same error came
  • Even though I saw issues kinda similar to this, I am aiming to provide the issue with maximum details
  • My tab: Lenovo Tab E8
  • Android version: Pie, 9.0
  • If need anymore details, please ask me
@haruki-py haruki-py added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Mar 27, 2024
@coder-labeler coder-labeler bot added the os-android Android/Termux related label Mar 27, 2024
@haruki-py haruki-py changed the title Android: UserLAnd docs not working Android: UserLAnd code-server docs causing error Mar 27, 2024
@code-asher
Copy link
Member

Probably related:
#5561
#5430

Does the npm i argon2 command have any errors? Does npm rebuild help?

I think we should try moving away from argon2.

@haruki-py
Copy link
Author

haruki-py commented Mar 28, 2024

userland@localhost:~$ npm i argon2

up to date, audited 5 packages in 9s

found 0 vulnerabilities

@haruki-py
Copy link
Author

haruki-py commented Mar 28, 2024

userland@localhost:~$ npm rebuild
rebuilt dependencies successfully

@haruki-py
Copy link
Author

I tried running code-server again and same issue

@haruki-py
Copy link
Author

#5561 is about termux. I can get it working on termux but I want in Ubuntu due to some reason like systemctl.
I think #5430 is related to this though

@code-asher
Copy link
Member

code-asher commented Mar 29, 2024

Yeah I am not sure, it seems like either a bug in argon2 or npm.

Although, the prompt says you are in ~; is that the right directory? I would expect it to be /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server.

cd /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server
npm rebuild # could also try npm i argon2

@haruki-py
Copy link
Author

userland@localhost:~/.nvm/versions/node/v18.20.0/lib/node_modules/code-server$ npm rebuild # could also try npm i argon2
npm ERR! code 7
npm ERR! path /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
npm ERR! node-pre-gyp info using node@18.20.0 | linux | arm
npm ERR! node-pre-gyp info check checked for "/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2/lib/binding/napi-v3/argon2.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.31.1/argon2-v0.31.1-napi-v3-linux-arm-glibc.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.31.1/argon2-v0.31.1-napi-v3-linux-arm-glibc.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for argon2@0.31.1 and node@18.20.0 (node-v108 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.31.1/argon2-v0.31.1-napi-v3-linux-arm-glibc.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@18.20.0 | linux | arm
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@18.20.0 | linux | arm
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/userland/.cache/node-gyp/18.20.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/home/userland/.cache/node-gyp/18.20.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/userland/.cache/node-gyp/18.20.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! node-pre-gyp ERR! UNCAUGHT EXCEPTION
npm ERR! node-pre-gyp ERR! stack Error: ENOTEMPTY: directory not empty, rmdir 'build-tmp-napi-v3/Release/obj.target'
npm ERR! node-pre-gyp ERR! stack     at Object.rmdirSync (node:fs:1222:10)
npm ERR! node-pre-gyp ERR! stack     at rmkidsSync (/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:349:27)
npm ERR! node-pre-gyp ERR! stack     at rmdirSync (/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:329:7)
npm ERR! node-pre-gyp ERR! stack     at rimrafSync (/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:301:9)
npm ERR! node-pre-gyp ERR! stack     at /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:336:39
npm ERR! node-pre-gyp ERR! stack     at Array.forEach (<anonymous>)
npm ERR! node-pre-gyp ERR! stack     at rmkidsSync (/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:336:26)
npm ERR! node-pre-gyp ERR! stack     at rmdirSync (/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:329:7)
npm ERR! node-pre-gyp ERR! stack     at rimrafSync (/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:301:9)
npm ERR! node-pre-gyp ERR! stack     at /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/rimraf/rimraf.js:336:39
npm ERR! node-pre-gyp ERR! System Linux 4.9.117+
npm ERR! node-pre-gyp ERR! command "/home/userland/.nvm/versions/node/v18.20.0/bin/node" "/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/argon2
npm ERR! node-pre-gyp ERR! node -v v18.20.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11

npm ERR! A complete log of this run can be found in: /home/userland/.npm/_logs/2024-03-30T01_56_58_846Z-debug-0.log
userland@localhost:~/.nvm/versions/node/v18.20.0/lib/node_modules/code-server$ npm i argon2
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/.argon2-DrvUQdTV',
npm WARN cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/.argon2-DrvUQdTV/build-tmp-napi-v3/Release/obj.target'] {
npm WARN cleanup       errno: -39,
npm WARN cleanup       code: 'ENOTEMPTY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: '/home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/.argon2-DrvUQdTV/build-tmp-napi-v3/Release/obj.target'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]

added 333 packages, changed 1 package, and audited 521 packages in 2m

161 packages are looking for funding
  run `npm fund` for details

2 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues, run:
  npm audit fix --force

Run `npm audit` for details.

@haruki-py
Copy link
Author

Im bad at js. I mean really bad in js. My main language is python but I tried with my very lil knowledge bout js and tried my maximum then only I opened this issue

@code-asher
Copy link
Member

code-asher commented Apr 2, 2024

No worries, npm is tricky especially with native modules like argon2.

I am not sure why ENOTEMPTY would happen here. I am reading online this can happen when there are network issues or other random failures, so it might be ephemeral. Does it persist if you run npm rebuild again? What about if you remove that directory (rm /home/userland/.nvm/versions/node/v18.20.0/lib/node_modules/code-server/node_modules/.argon2-DrvUQdTV -r) and then run npm rebuild again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os-android Android/Termux related triage This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants