美文网首页
CentOS8.2 安装 Python、Node、git、ngi

CentOS8.2 安装 Python、Node、git、ngi

作者: 秋天下雨淋湿冬天 | 来源:发表于2023-05-09 18:46 被阅读0次

用阿里云版本的 CentOS8.2,安装之后是默认有 python3


image.png

先安装python环境

ln -s /usr/bin/python3.6 /usr/bin/python
ln -sf /usr/bin/pip3 /usr/bin/pip
image.png

安装nvm环境

0、在线安装办法,基本不成功

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
#或者 如果wget不存在 执行yum -y install wget
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

1、这里使用下载安装包形式安装

wget https://github.com/nvm-sh/nvm/archive/refs/tags/v0.38.0.tar.gz

2、解压到指定目录 /root/.nvm

tar -zxvf v0.38.0.tar.gz --strip-components 1  -C /root/.nvm

3、配置环境

vi ~/.bashrc
//也可进入到相应的 文件下修改文件
在~/.bashrc的末尾,添加如下语句:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

4、配置生效 重启配置

source ~/.bashrc

5.验证nvm是否安装成功

nvm --version
0.38.0

安装node环境

nvm list-remote
nvm install v16.16.0
node -v

安装常用包

npm install -g yarn
npm install -g cnpm
npm install -g pnpm
npm install -g pm2
yum install -y nginx
yum install -y git
yum install -y nload
pip install ngxtop

相关文章

网友评论

      本文标题:CentOS8.2 安装 Python、Node、git、ngi

      本文链接:https://www.haomeiwen.com/subject/fiarsdtx.html