0

verdaccio 插件 allow_publish(package) 的版本未定义

class DynamicGroupPlugin {
  constructor(config, stuff) {
    this.config = config;
    console.log(`config`, this.config)
  }

  allow_publish(user, pkg, callback) {
    console.log(`pkg`, pkg)
    console.log(`pkgVersion`, pkgVersion)
    callback(null, false)
  }
}

module.exports = (cfg, stuff) => new DynamicGroupPlugin(cfg, stuff);

输出日志:


pkg { name: 'verdaccio-publishauth',
  version: undefined,
  access: [ '$all' ],
  publish: [ '$authenticated' ],
  unpublish: [ '$authenticated' ],
  proxy: [ 'npmjs' ] }
pkgVersion undefined


我怎样才能获得公共版本

4

0 回答 0