文档说明:只记录关键地方;
试验环境: webIDE vscode网页版 code-server
目标: webIDE 终端 里能快速使用 golang, nodejs, python3, pip3
| test ! -f /etc/apt/source.list.save && cp /etc/apt/sources.list /etc/apt/sources.list.save |
| sed -i "s@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list && \ |
| sed -i "s@security.debian.org@mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list |
| |
| apt update -y && apt install -y curl vim sudo tini libssl-dev ca-certificates && \ |
| apt install -y git curl wget make cmake gcc g++ python3 python3-pip ninja-build && \ |
| apt install -y net-tools dnsutils iproute2 procps iputils-ping |
| |
| |
快速安装golang 环境
| #!/bin/bash |
| set -exu |
| |
| __CURRENT__=`pwd` |
| __DIR__=$(cd "$(dirname "$0")";pwd) |
| cd ${__DIR__} |
| |
| kernel_name=$(uname -s) |
| echo "$kernel_name" |
| |
| |
| |
| golang_linux="https://golang.google.cn/dl/go1.19.2.linux-amd64.tar.gz" |
| golang_mac="https://golang.google.cn/dl/go1.19.2.darwin-amd64.pkg" |
| golang_win="https://golang.google.cn/dl/go1.19.2.windows-amd64.msi" |
| if test "$kernel_name" = "Linux"; then |
| { |
| if [ ! -f go1.19.2.linux-amd64.tar.gz ] |
| then |
| { |
| curl -L -O $golang_linux |
| tar -zxvf go1.19.2.linux-amd64.tar.gz |
| } |
| fi |
| export PATH=$PATH:${__DIR__}/go/bin/ |
| |
| } |
| elif test "$kernel_name" = "Darwin"; then |
| { |
| if [ ! -f go1.19.2.linux-amd64 ] |
| then |
| { |
| curl -L -O $golang_mac |
| |
| } |
| fi |
| export PATH=$PATH:${__DIR__}/go/bin/ |
| |
| } |
| else |
| { |
| |
| |
| if [ ! -f go1.19.2.windows-amd64.msi ] |
| then |
| curl -L -O $golang_win |
| |
| fi |
| |
| } |
| fi |
| |
| |
| $user=$(whoami) |
| GOPATH=/home/$user/gopath |
| mkdir -p /home/$user/gopath |
| |
| |
快速安装nodejs
| #!/bin/bash |
| set -exu |
| |
| __CURRENT__=`pwd` |
| __DIR__=$(cd "$(dirname "$0")";pwd) |
| cd ${__DIR__} |
| |
| kernel_name=$(uname -s) |
| echo "$kernel_name" |
| |
| |
| |
| |
| |
| version='18.12.0' |
| nodejs_linux="https://registry.npmmirror.com/-/binary/node/latest-v18.x/node-v${version}-linux-x64.tar.gz" |
| nodejs_mac="https://registry.npmmirror.com/-/binary/node/latest-v18.x/node-v${version}-darwin-x64.tar.gz" |
| nodejs_win="https://registry.npmmirror.com/-/binary/node/latest-v18.x/node-v${version}-win-x64.zip" |
| if test "$kernel_name" = "Linux"; then |
| { |
| if [ ! -f node-v${version}-linux-x64.tar.gz ] |
| then |
| { |
| curl -L -O $nodejs_linux |
| tar -zxvf node-v${version}-linux-x64.tar.gz |
| } |
| fi |
| export PATH=$PATH:${__DIR__}/node-v${version}-linux-x64/bin/ |
| |
| } |
| elif test "$kernel_name" = "Darwin"; then |
| { |
| if [ ! -f node-v${version}-darwin-x64.tar.gz ] |
| then |
| { |
| curl -L -O $nodejs_mac |
| tar -zxvf node-v${version}-darwin-x64.tar.gz |
| } |
| fi |
| export PATH=$PATH:${__DIR__}/node-v${version}-darwin-x64/bin/ |
| |
| } |
| else |
| { |
| |
| |
| if [ ! -f node-v${version}-win-x64.zip ] |
| then |
| curl -L -O $nodejs_win |
| unzip node-v${version}-win-x64.zip |
| fi |
| set PATH=%PATH%;${__DIR__}\\node-v${version}-win-x64\\bin |
| } |
| fi |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
.npmrc 文件
| registry=https://registry.npmmirror.com |
| electron_mirror=https://npmmirror.com/mirrors/electron/ |
| sass_binary_site=https://npmmirror.com/mirrors/node-sass/ |
| SASS_BINARY_SITE=http://npmmirror.com/mirrors/node-sass |
| puppeteer_download_host=https://npmmirror.com/mirrors/ |
| chromedriver_cdnurl=http://npmmirror.com/mirrors/chromedriver |
| PYTHON_MIRROR=http://npmmirror.com/mirrors/python |
| profiler_binary_host_mirror=http://npmmirror.com/mirrors/node-inspector/ |
| SQLITE3_BINARY_SITE=http://npmmirror.com/mirrors/sqlite3 |
| NVM_NODEJS_ORG_MIRROR=http://npmmirror.com/mirrors/node |
| NVMW_NPM_MIRROR=http://npmmirror.com/mirrors/npm |
| phantomjs_cdnurl=http://npmmirror.com/mirrors/phantomjs |
python3 pip
| |
| pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple |
| |
| |
参考文档
- golang cn mirror
- nodejs latest
- 构建php运行环境 php-fpm和php-cli两种模式
- aliyun pypi
- tsinghua PyPI 镜像使用帮助
- aliyun NPM
- 阿里云Go Module代理仓库服务
- npmjs
- cdnjs
- 校园网联合镜像站
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术