npm设置

  1. 查看npm安装目录:

    1
    npm root -g
  2. 查看npm的prefix和cache路径配置信息

    1
    2
    npm config get cache
    npm config get prefix
  3. 查看npm配置信息

    1
    npm config list
  4. 修改全局和缓存路径

    1
    2
    npm config set prefix E:Repositorysnpmnode_cache
    npm config set cache E:Repositorysnpmnode_global
  5. 设置镜像源

    1
    2
    npm config set registry https://registry.npm.taobao.org --global
    npm config set disturl https://npm.taobao.org/dist --global