ubuntu系统 Docker v20.10.14 、 Node.js v16.15.0 、Yarn v1.22.18 、 Npm v8.5.5 安装

Docker :20.10.14

step1:安装依赖

  1. sudo apt-get update

  2. sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common

step 2: 安装GPG证书

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

Step 3: 写入软件源信息

sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

Step 4: 更新并安装Docker-ce

  1. sudo apt-get -y update

  2. apt install -y docker-ce

step5:安装docker-compose

apt install -y docker-compose

step6:docker设置为开机自启

systemctl enable docker

step7:查看docker状态

sudo systemctl status docker

Node.js :v16.15.0 Yarn :1.22.18 Npm: 8.5.5

1nodejs & npm 安装

执行这个脚本会安装node16.x的版本。

脚本名字:install_nodejs.sh

vim install_nodejs.sh

添加一下内容

#!/bin/bash

# 安装更新Node.js和Npm所需要的软件

echo "update apt packge ..."

sudo apt update

# 添加NodeSource APT存储库和用于验证软件包的PGP密钥

echo "add NodeSource APT is PGP"

sudo apt install apt-transport-https curl ca-certificates software-properties-common

echo "add apt-get nodejs16.x and PGP" # 该行命令完成了apt-get存储库的添加并添加了PGP密钥

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

echo "install nodejs and npm...." # 安装Node

sudo apt-get install -y nodejs

执行命令

sh install_nodejs.sh

查看是否安装成功

node -v && npm -v

2yarn 安装

npm安装好后可以通过如下命令安装

npm install --global yarn

通过如下命令测试 Yarn 是否安装成功:

yarn --version

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值