wget https://nodejs.org/dist/v18.12.1/node-v18.12.1.tar.gz
tar zxf node-v18.12.1.tar.gz
cd node-v18.12.1
apt remove nodejs
./configure --prefix=/usr/local/node-v18.12.1
make -j `grep 'processor' /proc/cpuinfo | wc -l`
make install
ln -sf /usr/local/node-v18.12.1 /usr/local/nodev18
ln -sf /usr/local/nodev18 /usr/local/node
cat >/etc/profile.d/node.sh<<EOF
node_bin_path="/usr/local/node/bin"
if [ -n "${PATH##*${node_bin_path}}" ] && [ -n "${PATH##*${node_bin_path}:*}" ]; then
export PATH="$PATH:${node_bin_path}"
fi
EOF
[ubuntu]编译安装node
未经允许不得转载:笨笨天地 » [ubuntu]编译安装node
相关推荐
- 暂无文章