From ded4210eff9ffaeaefd2a9af7ce0cfd3abe484cc Mon Sep 17 00:00:00 2001 From: ArkhipovK Date: Mon, 22 Jan 2018 14:43:17 +0600 Subject: [PATCH] strapi new connection config fail fix #476 #485 issues --- packages/strapi-generate-new/lib/before.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/strapi-generate-new/lib/before.js b/packages/strapi-generate-new/lib/before.js index 70042d4c40..1147d62ab4 100755 --- a/packages/strapi-generate-new/lib/before.js +++ b/packages/strapi-generate-new/lib/before.js @@ -187,14 +187,14 @@ module.exports = (scope, cb) => { }); }), new Promise(resolve => { - let cmd = `npm install --prefix ${scope.rootPath} ${scope.client.connector}@alpha`; + let cmd = `npm install --prefix "${scope.rootPath}" ${scope.client.connector}@alpha`; if (scope.client.module) { cmd += ` ${scope.client.module}`; } exec(cmd, () => { if (scope.client.module) { - const lock = require(`${scope.rootPath}/node_modules/${scope.client.module}/package.json`); + const lock =require(path.join(`${scope.rootPath}`,`/node_modules/`,`${scope.client.module}/package.json`)); scope.client.version = lock.version; } @@ -206,7 +206,7 @@ module.exports = (scope, cb) => { Promise.all(asyncFn) .then(() => { try { - require(path.resolve(`${scope.rootPath}/node_modules/${scope.client.connector}/lib/utils/connectivity.js`))(scope, cb.success, connectionValidation); + require(path.join(`${scope.rootPath}`,`/node_modules/`,`${scope.client.connector}/lib/utils/connectivity.js`))(scope, cb.success, connectionValidation); } catch(err) { shell.rm('-r', scope.rootPath); logger.info('Copying the dashboard...');