• npm 配置


    1.使用代理npm 安装某个module

    https_proxy=http://代理地址 npm install module

    2.设置configure

    npmrc Files

    The four relevant files are:

    • per-project configuration file (/path/to/my/project/.npmrc)
    • per-user configuration file (defaults to $HOME/.npmrc; configurable via CLI option--userconfig or environment variable $NPM_CONF_USERCONFIG)
    • global configuration file (defaults to $PREFIX/etc/npmrc; configurable via CLI option --globalconfig or environment variable$NPM_CONF_GLOBALCONFIG)
    • npm's built-in configuration file (/path/to/npm/npmrc)

    这是我的$HOME/.npmrc的简单配置

        prefix = /usr/local                 # npm 地址 /usr/local/bin/npm
        registry = http://registry.npm.taobao.org/    #淘宝镜像
        strict-ssl = false                   # 不启用https

    3. Default Configs 默认设置

     Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified.

    npm config ls -l 查看配置 ,其中包括userconfig,default,globalconfig等配置

    一般在$HOME/.npmrc 中修改内容.

    https://docs.npmjs.com/misc/config罗列了一些默认值以及含义.

  • 相关阅读:
    202011.19
    202011.18
    202011.17
    202011.16
    202011.14
    jdk的下载和配置
    layui中form表单
    JS中utocomplete
    转:JqueryUI学习笔记-自动完成autocomplete
    JSON.parse()与JSON.stringify()的区别
  • 原文地址:https://www.cnblogs.com/jay--zhang/p/6655673.html
Copyright © 2020-2023  润新知