How to install nodejs for Android system (Huawei mate9)

Reference link You can also happily engage in nodejs development on mobile phones

I received a request today to install a nodejs environment on an Android phone. In fact, I refused at first because I am not an Android developer and am not familiar with the mobile phone system, but the demand is here. At the
beginning, my Baidu is Android running node. There are indeed a few tutorials on the Internet, but it requires a certain Android foundation and familiarity with Android development tools. So this time I wrote this article with Android keywords, so that people in the future will avoid detours.
Later, I searched for the mobile phone node keyword, and I found it. You can also happily engage in nodejs development on mobile phones . This article is easy to solve, Thanks here! It is enough for everyone to go directly to the original article to read, but, after all, to write a blog post, I will repeat it again.

Tool preparation

  • Android phone (pro-test Huawei mate9 real machine)
  • I found and downloaded the Termux advanced terminal on the Internet. I will share the link here. Baidu network disk download
  • Install Termux on your phone
  • The original blog recommends installing Hacker's Keyboard programming keyboard

Start

Termux comes with a package management tool apt, so install nodejs directly

apt update
apt install nodejs

Generally, the latest stable version will be installed directly. For example, I will install v8.9 this time.
Well, test it.

node -v

If you are familiar with node, you can already play happily

Precautions

Because of Android permission management, you can't write files anywhere you want. Your scope of activity must be within Termux's authority, that is, in the data/data/com.termux/files directory. Although you can write files to the SD card, some packages will fail when symbollinking, so it is safe to do all operations in the HOME directory, ie data/data/com.termux/files/home directory.

The original blog is directly quoted, please pay attention!

If there is any infringement, please inform to delete, thank you!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325430549&siteId=291194637