目的:使用手机搭建node-red服务器,通过手机浏览器访问本地服务
1.下载 termux apk
https://termux.com/
2. 修改镜像源
运行 termux 执行 ,分别以下4个命令
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list
sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list
apt update && apt upgrade
3. 安装 node
apt install nodejs
4. 使用 nrm 切换 npm 镜像源
npm i nrm -g
nrm use taobao
5. 安装 node-red
npm i node-red -g
6. 启动 node-red
node-red
7. 使用手机浏览器 访问 http://127.0.0.1:1880
服务启动完成