code-server: Yarn installation fails incompatible engine 'node'

OS/Web Information

  • Web Browser: ~
  • Local OS: Android q aarch64 (arm64)
  • Remote OS: ~
  • Remote Architecture: ~
  • code-server --version: latest

Steps to Reproduce

  1. Latest termux version
  2. apt update && apt upgrade && apt install build-essential python git nodejs-lts yarn

3.yarn global add code-server

Expected

Install?

Actual

yarn complains about nodejs version expected v14 (the old lts) The problem is the nodejs-lts is now v16 how can i get v14? Should I go with the standalone install?

Screenshot

Screenshot_20211029_232247

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@RoyGalaxy, @code-asher told VS-Code is not compatible with that Node.js version yet, so the least we can do is just wait. Or, if you use Termux, persuade theyr developers to downgrade Node package, or make them offer a build 14 as a separate package, which is what I’m trying to do here: https://github.com/termux/termux-packages/issues/7930

Look at the link, it now works!

We are stuck using the version of Node that VS Code supports unfortunately (I did test 16 just to see but it was not compatible).

Workaround: use VHEditor https://github.com/vhqtvn/VHEditor-Android

By the way, all we need to do is targeting the latest node.js version. I hope it’s easy enough

Edit: For the records, here is the issue https://pastebin.com/AYyUkABU

Note I’m using nodejs-lts package from Termux repository

Btw, i digged in my old backups i found code-server with node 14 installed I’m using it and it’s working fine, I want to pack a .deb of node 14 for sharing if any one wants it, also so I can install on other devices,

anyone know if it’s possible to pack a .deb package of node?

In fact, I’m having troubles with extensions, beside this, it works

Look at this: https://github.com/termux/termux-packages/issues/7930#issuecomment-961784596

Ah yeah I should have mentioned you can force this with:

FORCE_NODE_VERSION=16 yarn global add code-server --ignore-engines

Anything above 14 is untested so use at your own risk! 😃

I also tried nvm and the --ignore-engines flag while installing via yarn none of them worked kindly make code-server compatible with v16 of node 🙏

Chiming in as I’m also attempting to do a new install with a similar environment.

nvm doesn’t work on Termux because Termux is now required to use a PREFIX env var to work with Android 11’s new security policies. nvm does not allow this and the only suggestion I’ve seen is to clear the PREFIX, which is not possible without completely breaking Termux.

I’ve also attempted to use n, which is a similar solution for running multiple instance of Node, however, n doesn’t appear to install a version of Node compatible with the OS. It may still be a solution, though more testing is needed, but I currently believe Termux/Android users are stuck with only latest and -lts versions of Node.

Node v14 is the newest version supported by code-server at this time.

Unfortunately v14 isn’t available anymore according to node the new nodejs-lts v16 started 5 days ago, and I can’t find the old package in archives, i think you will have to somehow support the new lts?

Argh, this seems to be blocking a lot of people. Can you check the node-argon2 docs here?

I had a backup of my previous install, i will stick with it for now with code-server v3.9.3, i will test again with steps from node-argon2 when I’m free, thanks guys for your efforts