node 管理模块 npm 的常用配置

1,修改 npm 下载模块的 保存地址

  <1>  进入 cmd 运行, 如下命令

    npm config set prefix "依赖目录"

    npm config set cache "缓存目录"

  <2> 修改 PATH 里的环境变量路径为: 新地址

2, 修改 下载仓库为淘宝镜像

  npm config set registry http://registry.npm.taobao.org/

3,如果要发布自己的镜像需要修改回来

  npm config set registry https://registry.npmjs.org/

4,发布自己的模块

  npm login

  npm publish

原文地址:https://www.cnblogs.com/lovling/p/6957734.html