node 安装
Last updated on January 18, 2025 am
🧙 Questions
☄️ Ideas
windows安装
linux安装
sudo yum install npm -y
sudo yum install nodejs -y
linux源码安装
cd /tmp
tar -xvJf node-v18.20.5-linux-x64.tar.xz
mv node-v18.20.5-linux-x64 /opt/
ln -s /opt/node-v18.20.5-linux-x64 /opt/node
linux 指定版本安装
# 推荐nodejs在18.x以上
curl --silent --location https://rpm.nodesource.com/setup_18.x | sudo bash
sudo yum install nodejs -y
修改环境变量
sudo vim /etc/profile
# node
export NODE_HOME=/opt/node
export PATH=$PATH:${NODE_HOME}/bin
source /etc/profile
# wget http://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
# tar xf glibc-2.28.tar.gz
# cd glibc-2.28/ && mkdir build && cd build
# yum install -y centos-release-scl
# yum install -y devtoolset-8-gcc*
# mv /usr/bin/gcc /usr/bin/gcc-4.8.5
# ln -s /opt/rh/devtoolset-8/root/bin/gcc /usr/bin/gcc
# mv /usr/bin/g++ /usr/bin/g++-4.8.5
# ln -s /opt/rh/devtoolset-8/root/bin/g++ /usr/bin/g++
# wget http://ftp.gnu.org/gnu/make/make-4.3.tar.gz
# tar -xzvf make-4.3.tar.gz && cd make-4.3/
# ./configure --prefix=/usr/local/make
# make && make install
# cd /usr/bin/ && mv make make.bak
# ln -sv /usr/local/make/bin/make /usr/bin/make
# yum install -y bison
# ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
# make && make install
🔍 Reference
node 安装
https://ispong.isxcode.com/vue/node/node 安装/