阿里云centOS食用方法&升级Python及yarn配料
环境搭建
安装node
yum -y install gcc make gcc-c++ openssl-devel wgetwget npm.taobao.org/mirrors/node/v8.4.0/node-v8.4.0-linux-x64.tar.xztar -vxf node-v8.4.0-linux-x64.tar  
/etc/profile加入(注意地址)
1  | #node(注释)  | 
source /etc/profilenode -v
升级Python
- 确认依赖
yum -y groupinstall developmentyum -y install zlib-devel - 下载包 (感觉慢的话先下载到本地然后Winscp上传到服务器)
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xztar xJf Python-3.6.2.tar.xzcd Python-3.6.2 - 编译
./configuremakemake installwhich python3python3 -V - 安装成功,查看环境变量
echo $PATH - 发现没有3,添加
PATH=$PATH:/usr/bin/local/python/bin/python3.6 - 看下默认版本,还是2,那就删除
python - /usr/bin将python2.7删除,建立连接
ln -s /usr/local/bin/python/bin/python ./python - 尝试
python,3.6安装成功 
yarn食用
先装淘宝镜像npm install cnpm -g --registry=https://registry.npm.taobao.org
然后cnpm i -g yarn
仓库设置cnpmyarn config set registry "https://registry.npm.taobao.org"
命令
| npm命令 | yarn命令 | 
|---|---|
| npm install | yarn | 
| npm install xxx [—save,-dev] | yarn add xxx[—D] | 
| npm install xxx -g | yarn global add xxx | 
| npm uninstall xxx [—save,-dev] | yarn remove xxx | 
| npm update | yarn upgrade | 
| 列出依赖taco的其他包 | yarn why taco | 
其他都一样,包括npm run dev npm init 改为yarn就行