node 安装及npm 缓存设置

node 下载

https://nodejs.org/en/

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全局安装
上一篇
下一篇