登峰造极境

  • WIN
    • CSharp
    • JAVA
    • OAM
    • DirectX
    • Emgucv
  • UNIX
    • FFmpeg
    • QT
    • Python
    • Opencv
    • Openwrt
    • Twisted
    • Design Patterns
    • Mysql
    • Mycat
    • MariaDB
    • Make
    • OAM
    • Supervisor
    • Nginx
    • KVM
    • Docker
    • OpenStack
  • WEB
    • ASP
    • Node.js
    • PHP
    • Directadmin
    • Openssl
    • Regex
  • APP
    • Android
  • AI
    • Algorithm
    • Deep Learning
    • Machine Learning
  • IOT
    • Device
    • MSP430
  • DIY
    • Algorithm
    • Design Patterns
    • MATH
    • X98 AIR 3G
    • Tucao
    • fun
  • LIFE
    • 美食
    • 关于我
  • LINKS
  • ME
Claves
长风破浪会有时,直挂云帆济沧海
  1. 首页
  2. Platforms
  3. WEB
  4. 正文

npm/yarn/pnpm如何配置从多个源获取依赖包

2024-08-29

一、问题

博主私有部署了一个npm私有源,私有源的父级指向npmmirror.com,但是经常会出现私有源上没有指定版本的包,但npmmirror.com有此包的问题。

根本的问题还是解决私有源与npmmirror.com同步的问题,但是为了速度解决,采用从2个源拉取依赖包

二、yarn配置方法

.yarnrc.yml配置

nodeLinker: node-modules

npmRegistryServer: "https://registry.npmmirror.com"

unsafeHttpWhitelist:

  - nexus.mirrorxxxxxxx.com.cn

npmScopes:

  iios-cloud:

    npmRegistryServer: "http://nexus.mirrorxxxxxxx.com.cn/repository/npm-group/"

三、pnpm配置方法

新建.npmrc文件:

# 设置默认的 registry
registry=https://registry.npmmirror.com

# 为特定的 scope 设置 registry
@scope1:registry=http://nexus.mirrorxxxxxxx.com.cn/repository/npm-group/
标签: 暂无
最后更新:2024-09-05

代号山岳

知之为知之 不知为不知

点赞
< 上一篇
下一篇 >

COPYRIGHT © 2099 登峰造极境. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

蜀ICP备14031139号-5

川公网安备51012202000587号