gitlab-runner环境配置

日常问题记录

jdk环境

1

maven环境

1
2


node 环境

下载

1
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash

环境变量

1
2
3
4
5
source ~/.bashrc

#可以看见如下的环境变量已经被加载过了
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

修改源

1
2
#在~/.bashrc里面加入如下,设置淘宝源
export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node

常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#查看远程的node可用版本
export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node
export NVM_NPM_ORG_MIRROR=https://npmmirror.com/mirrors/npm
export NVM_IOJS_ORG_MIRROR=https://npmmirror.com/mirrors/iojs

nvm list-remote

#安装一个指定版本的nodejs
nvm install v18.18.2

#卸载指定版本的nodejs
nvm uninstall v12.12.0

#查看本地可用的nodejs版本
nvm ls

#查看当前指向的nodejs版本
nvm current

指定node默认版本
nvm alias default v12.12.0

#查看安装了哪些包
npm list --depth=0 -g