打开 C:\Users\Administrator\.atom 目录下的.apmrc配置文件(没有就新建一个),然后添加代理信息:
npm 代理为 C:\Users\Administrator
strict-ssl=false
https-proxy=http://127.0.0.1:1080/
http-proxy =http://127.0.0.1:1080/
npm config set proxy http:127.0.0.1
git 代理设置 :
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
git设置ssh代理 :
如果你复制url的时候选的是“Clone with SSH”,那么克隆的时候走的就是SSH协议,而不是HTTP/HTTPs协议。需要在~/.ssh/config中配置代理:
Host github.com
User git
Hostname github.com
ProxyCommand connect -S 127.0.0.1:1080 %h %p
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
npm 配置:
查看所有配置:npm config list
npm的常用命令:
npm install xxx 安装模块
npm install xxx@1.1.1 安装1.1.1版本的xxx
npm install xxx -g 将模块安装到全局环境中。
npm ls 查看安装的模块及依赖
npm ls -g 查看全局安装的模块及依赖
npm uninstall xxx (-g) 卸载模块
npm cache clean 清理缓存
npm help xxx 查看帮助
npm update moduleName 更新node模块