asdf 安装 python 与 nodejs

asdf 安装 python 与 nodejs

系统 centos 7.9

安装 asdf

官方地址:asdf-vm/asdf: Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more (github.com)

clone 代码:

yum install git -y
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2

vi ~/.bashrc 添加以下内容:

. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash

安装插件

支持插件:asdf-vm/asdf-plugins: Central plugin repository for asdf (github.com)

安装 nodejs

asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs 12.22.6
  • 卸载 asdf uninstall nodejs 12.22.6

安装 python

安装依赖

yum install -y epel-release
yum install -y autoconf curl expat gcc make gettext libiconv openssl openssl-devel unzip zlib zlib-devel libcurl-devel curl-devel libffi-devel bzip2-devel ncurses-devel readline-devel lzma sqlite-devel python-backports-lzma lzma-sdk lzma-sdk-devel xz-devel
asdf plugin add python
asdf install python 3.9.13

查看安装的插件和软件版本

asdf list

设置默认加载版本

vi ~/.tool-versions

nodejs 12.22.6
python 3.9.13
posted @ 2022-09-28 15:02  leffss  阅读(550)  评论(0编辑  收藏  举报