diff --git a/services/service-package-registry/main/default/manager/registry.js b/services/service-package-registry/main/default/manager/registry.js index 4821fc76fa..976b7a52c1 100644 --- a/services/service-package-registry/main/default/manager/registry.js +++ b/services/service-package-registry/main/default/manager/registry.js @@ -121,7 +121,7 @@ async function installModule(module, version, url, registry_url) { // if( check !== false){ // return check; // } - // console.log(`installModule`, module,version,url) + console.log(`install page`, module, version, url) module = module || ""; activePromise = activePromise.then(async function() { //TODO: ensure module is 'safe' @@ -193,7 +193,7 @@ async function installModule(module, version, url, registry_url) { var installDir = settings.userDir || "."; var args = ['install','--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=~','--production',installName]; - var yarnArgs = ['add', '-E', installName, '--json']; //yarnCommand , '--json' --registry + var yarnArgs = ['add', '-E', ...installName.split(' '), '--json']; //yarnCommand , '--json' --registry if (false && registry_url) { yarnArgs.push('--registry') yarnArgs.push(registry_url) diff --git a/services/service-package-registry/project.package.service.js b/services/service-package-registry/project.package.service.js index 632a17ac98..642bd636f0 100644 --- a/services/service-package-registry/project.package.service.js +++ b/services/service-package-registry/project.package.service.js @@ -394,6 +394,7 @@ module.exports = { async handler(){ const settings = this.settings; const packages = settings.STEEDOS_INITIAL_PACKAGES; + console.log('install initial packages: ', STEEDOS_INITIAL_PACKAGES); if(_.isString(packages) && packages){ for (const packageName of packages.split(',')) { try { @@ -430,7 +431,7 @@ module.exports = { await this.installPackageFromUrl(installProps.url, installProps.version, installProps.url, null, true, null, this.broker); }else{ //module, version, label, description, enable, broker - await this.installPackage(installProps.name, installProps.version, null, null, true, this.broker); + await this.installPackage(process.env.NPM_REGISTRY_URL ? `${installProps.name} --registry ${process.env.NPM_REGISTRY_URL}` : installProps.name, installProps.version, null, null, true, this.broker); } } catch (error) { this.broker.logger.error(`initialPackages: ${packageName}. ${error.message}`); diff --git a/services/service-steedos-server/index.js b/services/service-steedos-server/index.js index 5b365a2d55..8502f423c6 100644 --- a/services/service-steedos-server/index.js +++ b/services/service-steedos-server/index.js @@ -82,10 +82,10 @@ module.exports = { steedosConfig.setTenant({ enable_create_tenant: true, enable_register: true }); } // 工作区未初始化时,才初始化软件包 - const allowInit = await this.allowInit(records); - if (!allowInit) { - return - } + // const allowInit = await this.allowInit(records); + // if (!allowInit) { + // return + // } try { await ctx.broker.call('@steedos/service-project.initialPackages', {}, {}); } catch (error) {