cnpm的安装
- 安装node 打开cmd
2.node -v 查看node是否已安装
3.安装淘宝镜像
npm install -g cnpm -registry=https://registry.npm.taobao.org
4.查看cnpm是否真安装成功 cnpm -v
5.安装yarn
npm install -g yarn
6.查看版本:yarn --version
7.Yarn 淘宝源安装,分别复制粘贴以下代码行到黑窗口运行即可
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
报错:
1、info There appears to be trouble with your network connection. Retrying…
安装好后更换淘宝镜像
yarn config set registry https://registry.npm.taobao.org
移除原代理(慎用)
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy
安装cnpm镜像并使用代理registry
安装cnpm镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用代理registry
npm config set registry https://registry.npm.taobao.org