Skip to content

Update termux.md #5233

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

Closed
wants to merge 2 commits into from
Closed

Update termux.md #5233

wants to merge 2 commits into from

Conversation

mrfoxie
Copy link
Contributor

@mrfoxie mrfoxie commented May 29, 2022

yarn Installation works perfectly fine in mine👍🏻

Fixes #

yarn Installation works perfectly fine in mine👍🏻
@mrfoxie mrfoxie requested a review from a team May 29, 2022 19:31
@jsjoeio jsjoeio self-assigned this May 31, 2022
@jsjoeio jsjoeio added the docs Documentation related label May 31, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented May 31, 2022

Thanks for doing this! However, I think in #5010 we decided to only suggest npm due to some issues related to how it respects dependencies so I don't think we want to recommend this right now.

Is that right? @code-asher

@code-asher
Copy link
Member

We still need to fix a few things with npm (#5071) so for now yarn is the way to go. I think we could merge this then come back and update with npm once 5071 is merged (we will need to update all over the documentation anyway).

jsjoeio
jsjoeio previously approved these changes May 31, 2022
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

@jsjoeio
Copy link
Contributor

jsjoeio commented May 31, 2022

You can run yarn fmt locally to fix this

@thx2001r
Copy link
Contributor

@mrfoxie and @jsjoeio: This is awesome, thanks for putting this together!!! Installation only works after a few necessary changes:

Error:
Installing nodejs pkg currently sets up node v18.3.0. The Yarn installer bombs out saying that it:

Expected version "16". Got "18.3.0"

Fix: Install nodejs-lts package instead that is on v16.x!

Error:
During install the Yarn installer bombs out as it couldn't locate ar (handles archives):

/data/data/com.termux/files/usr/bin/sh: 1: ar: not found

Fix: Install binutils package that contains ar

Improvement:
Your script updates NPM to a specific version number 8.11.0. This is already outdated and at v8.12.2 as of today!

Proposed change to always update to the latest version:

npm install -g npm@latest

Proposed changes all together:

Yarn Installation

  1. Get Termux from F-Droid.
  2. Install necessary packages
pkg install -y \
  build-essential \
  binutils \
  pkg-config \
  python3 \
  yarn \
  nodejs-lts
npm config set python python3
npm i -g npm@latest
  1. Now install code-server
yarn global add code-server
code-server --auth none

@mrfoxie
Copy link
Contributor Author

mrfoxie commented Jun 20, 2022

let me have a look at it

@thx2001r
Copy link
Contributor

let me have a look at it

Indeed, please try on a clean install of Termux (you can clear storage on Termux for this as well).

@mrfoxie
Copy link
Contributor Author

mrfoxie commented Jun 20, 2022

let me have a look at it

Indeed, please try on a clean install of Termux (you can clear storage on Termux for this as well).

thanks for pointing out the issue I'm looking into it just give me some time I will resolve it

@thx2001r
Copy link
Contributor

Happy to help!

I take it back on my proposed improvement npm install -g npm@latest... that latest version is having all kinds of issues. Please disregard my proposed improvement on that 🤦‍♂️

@mrfoxie
Copy link
Contributor Author

mrfoxie commented Jun 20, 2022

Happy to help!

I take it back on my proposed improvement npm install -g npm@latest... that latest version is having all kinds of issues. Please disregard my proposed improvement on that man_facepalming

I don't know why it is not working now. It was working first just give me some time I will come back to it as soon as possible and solve this issue. There must be some conflict between yarn nodejs nodejs-lts. I will find a better solution for it so that users can enjoy coding on android devices. If you can help me out figuring which version does code-server is using on Linux devices so that I can make it better steps for installation of code-server.

@thx2001r
Copy link
Contributor

thx2001r commented Jun 20, 2022

Happy to help!
I take it back on my proposed improvement npm install -g npm@latest... that latest version is having all kinds of issues. Please disregard my proposed improvement on that man_facepalming

I don't know why it is not working now. It was working first just give me some time I will come back to it as soon as possible and solve this issue. There must be some conflict between yarn nodejs nodejs-lts. I will find a better solution for it so that users can enjoy coding on android devices. If you can help me out figuring which version does code-server is using on Linux devices so that I can make it better steps for installation of code-server.

It's literally just that code-server installer checks for Node 16.x at this point see: https://coder.com/docs/code-server/latest/npm#nodejs-version

Incidentally, since Node and Termux recently switched from Node v14 to v16 for its LTS package, and code-server hadn't been updated to work with v16 yet, the whole set of instructions with PRoot were created so that NVM could be leveraged to install older Node versions for code-server alongside other more modern versions.

Now that code-server supports Node v16 (#4286), it's cool that install via Yarn works well again!

Something like the following should work from the terminal with Node 18 in the nodejs termux package but I think installing Node 16 via the nodejs-lts termux package or NVM is cleaner:

FORCE_NODE_VERSION=18 yarn global add code-server

@mrfoxie
Copy link
Contributor Author

mrfoxie commented Jun 21, 2022

pkg install -y
build-essential
binutils
pkg-config
python3
yarn
nodejs-lts
npm config set python python3

I think there must be an issue while the installation of nodejs version because it installs v18 I will try to change the repository and then try to reinstall it again

update:
finally, I got the solution for node v16.15.0 and it was installed successfully. I will open a new pull request and then add all the commands for direct yarn installation

@mrfoxie
Copy link
Contributor Author

mrfoxie commented Jun 21, 2022

@thx2001r just give this a try its 100% working now if its working properly then I will close this pull request and open a new one

Yarn Installation

  1. Get Termux from F-Droid.

  2. We will now change using the following command.

termux-change-repo

Now select Main Repository then change repo to Mirrors by Grimler Hosted on grimler.se.

  1. After successfully updating of repository update and upgrade all the packages by the following the command
pkg update
pkg upgrade -y
  1. Now let's install requirement dependancy.
pkg install -y \
  build-essential \
  binutils \
  pkg-config \
  python3 \
  yarn \
  nodejs-lts
npm config set python python3
node -v

you will get node version v16.15.0

  1. Now install code-server
yarn global add code-server
  1. Congratulation code-server is installed on your device using the following command.
code-server --auth none

@mrfoxie
Copy link
Contributor Author

mrfoxie commented Jun 21, 2022

We still need to fix a few things with npm (#5071) so for now yarn is the way to go. I think we could merge this then come back and update with npm once 5071 is merged (we will need to update all over the documentation anyway).

@code-asher don't merge this request I'm working on it it will take a little time may be 2 more days

@jsjoeio jsjoeio dismissed their stale review June 21, 2022 15:39

not ready for merge

@mrfoxie mrfoxie closed this Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants