ubuntu20.04.5--arm64版上使用node集成java

发布于:2025-06-01 ⋅ 阅读:(23) ⋅ 点赞:(0)

ubuntu20.04.5arm上使用node集成java

#ssh,可选
sudo apt update
sudo apt install openssh-server

sudo systemctl status ssh
sudo systemctl enable ssh
sudo systemctl enable  --now ssh

#防火墙相关,可选
sudo ufw allow ssh
sudo ufw allow 2222/tcp


#默认安装了python3  3.8.10,查看python版本,可选
python2
python3
python
python -V


#网络工具,可选
sudo apt install net-tools

#1
sudo apt install curl

#2
curl -fsSL  https://deb.nodesource.com/setup_16.x | sudo  -E bash -
sudo apt install -y  nodejs


#3 安装python2,设置python2为默认版本
sudo apt install python2

sudo update-alternatives --list  python

sudo update-alternatives  --install  /usr/bin/python python  /usr/bin/python2 1
sudo update-alternatives  --install  /usr/bin/python python  /usr/bin/python3 2

#设置python版本,选1
sudo update-alternatives --config  python
#验证 python 或 python -V  输出python版本 2.7.18


#4
sudo npm install node-gyp  -g

node-gyp --version

#5
sudo apt install openjdk-8-jdk
java -version

#6
sudo apt install make

#7
sudo apt install g++

#8
sudo npm install java --unsafe-perm

#9
tar -zcvf  node_modules-java.tar.gz  node_modules

#可选
npm install ws

#其他命令参考
npm cache clean --force
rm -rf node_modules

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install  python3.12.0

sudo npm install node-gyp@10.3.1  -g

sudo update-alternatives  --remove   /usr/bin/python3 


sudo apt-get remove  --purge python3
sudo apt-get autoremove

ip link show

sudo ip link set enp0s1 down
sudo ip link set enp0s1 up

设置ip
ifconfig enp0s1  192.168.137.2 netmask 255.255.255.0  up

sudo ip addr add  192.168.137.2/24 dev  enp0s1


 


网站公告

今日签到

点亮在社区的每一天
去签到