This guide will walk you through setting up node-native for Systemless Node.js.
To develop native Node.js modules, you'll need several Magisk modules:
npm
and yarn
.Currently, there is no Magisk Python module, so we will use Termux's Python.
Install Python in Termux:
# In Termux (not as root)
pkg update && pkg install python -y
Create a symbolic link for Python:
# Run this as root
ln -s /data/data/com.termux/files/usr/bin/python $PREFIX/bin/python
This makes the
python
binary usable as root.
Set up Git in a similar manner:
# In Termux (not as root)
pkg update && pkg install git -y
# Run this as root
ln -s /data/data/com.termux/files/usr/bin/git $PREFIX/bin/git
Before we can start building, we need npm
!
Install npm globally using yarn:
yarn global add npm@9
Clone the Git repository:
git clone https://github.com/Googlers-Repo/node-native.git
cd node-native
Install all necessary modules:
npm install
Run your native Node.js module:
node test.js
By following these steps, you'll have a working setup for developing and running native Node.js modules in a systemless environment. Happy coding!