当前位置:   article > 正文

Node-v16.14.2 install_nodejs 16.14.2

nodejs 16.14.2

方法1

wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz

tar -xvf node-v16.14.2-linux-x64.tar.xz

mv node-v16.14.2-linux-x64 /usr/local/

ln -s /usr/local/node-v16.14.2-linux-x64/bin/npm /usr/local/bin/npm

ln -s /usr/local/node-v16.14.2-linux-x64/bin/node /usr/local/bin/node

方法2(推荐)

curl -o node-v16.14.2.tar.xz  https://nodejs.org/dist/v16.14.2//node-v16.14.2-linux-x64.tar.xz

VERSION=v16.14.2

DISTRO=linux-x64

sudo mkdir /usr/local/lib/nodejs

sudo tar -xJvf node-$VERSION.tar.xz -C /usr/local/lib/nodejs

sudo mv /usr/local/lib/nodejs/node-v16.14.2-linux-x64 /usr/local/lib/nodejs/node-v16.14.2

export NODEJS_HOME=/usr/local/lib/nodejs/node-v16.14.2/bin

export PATH=$NODEJS_HOME:$PATH

cat >> /etc/profile <<EOF

export NODEJS_HOME=/usr/local/lib/nodejs/node-v16.14.2/bin

export PATH=$NODEJS_HOME:$PATH

EOF

source /etc/profile

ln -s /usr/local/lib/nodejs/node-v16.14.2/bin/npm /usr/local/bin/npm

ln -s /usr/local/lib/nodejs/node-v16.14.2/bin/node /usr/local/bin/node

ln -s /usr/local/lib/nodejs/node-v16.14.2/bin/pm2 /usr/local/bin/pm2

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/198110?site
推荐阅读
相关标签
  

闽ICP备14008679号