node 下载
npm 源设置
npm config set registry https://registry.npm.taobao.org
npm config set registry https://registry.npmjs.org/
验证
npm config get registry
如果返回https://registry.npm.taobao.org,说明镜像配置成功
npm 缓存设置
【D:\nodejs】下创建两个文件夹【node_global】及【node_cache】如下图:
npm config set prefix "D:\nodejs\node_global"
npm config set cache "D:\nodejs\node_cache"
npm get prefix
npm get cache
常用命令
| –save | -S | 是把依赖写入进dependencies对象里面 |
| –save-dev | -D | 依赖写入进devDependencies对象里面 |
| -g | 全局安装 |