Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

从私服同步的包无法publish #1593

Closed
shilucus opened this issue Sep 29, 2020 · 2 comments
Closed

从私服同步的包无法publish #1593

shilucus opened this issue Sep 29, 2020 · 2 comments

Comments

@shilucus
Copy link

背景:
已有私服A,搭建初期的目的只是为了某个部门使用。后续推广到全公司以后,重新搭建了私服B。然后从A同步了全部的私有包到B(通过修改sourceNpmRegistry实现)

问题:
在私服B上无法publish新的版本到某个包(使用的是管理员权限,并且已确认当前用户存在于此包的Maintainers中)

预期结果:
从A同步包到B以后可以正常publish

请问有什么办法可以解决吗?还是需要什么配置或者修改?

@shilucus
Copy link
Author

已通过修改源码实现

/controllers/sync_module_worker.js

afterUpload 函数中,1485行

delete mod.package._publish_on_cnpm;

// 修改为↓

if (mod.package.name.indexOf('@xxxx') != -1) {
    mod.package._publish_on_cnpm = true;
} else {
    delete mod.package._publish_on_cnpm;
}

@yagang94
Copy link

请问下从A同步了全部的私有包到B是怎么配置的呀,我这边配置的之后意外的会同步淘宝镜像的包

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants