以Win10为例,其他均为当前用户的Home目录下
~/pip/pip.ini
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
~/.npmrc
registry=https://registry.npm.taobao.org
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
** 小提示:
如果项目本身存在node_modules,但是配置后安装依赖包出现了异常,那么把.npmrc文件中的"registry=https://registry.npm.taobao.org"这一行去掉,重新安装或更新依赖即可
其他安装方式
npm install cnpm
cnpm install --registry=https://registry.npm.taobao.org
或
cnpm install [name] --registry=https://registry.npm.taobao.org
cnpm install [name] --通过使用npm安装你需要安装的库