diff --git a/package.json b/package.json index b5700c4f4d..4622922a45 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "private": true, "version": "3.0.0-alpha.12.3", + "dependencies": {}, "devDependencies": { "assert": "~1.3.0", "axios": "^0.18.0", diff --git a/packages/strapi-generate-new/lib/after.js b/packages/strapi-generate-new/lib/after.js index fbce4d5b37..35b5dc199b 100755 --- a/packages/strapi-generate-new/lib/after.js +++ b/packages/strapi-generate-new/lib/after.js @@ -12,7 +12,6 @@ const { execSync } = require('child_process'); const _ = require('lodash'); const fs = require('fs-extra'); const npm = require('enpeem'); -const getInstalledPath = require('get-installed-path'); // Logger. const logger = require('strapi-utils').logger; @@ -39,16 +38,17 @@ module.exports = (scope, cb) => { const dependencies = _.get(packageJSON, 'dependencies'); const strapiDependencies = Object.keys(dependencies).filter(key => key.indexOf('strapi') !== -1); const othersDependencies = Object.keys(dependencies).filter(key => key.indexOf('strapi') === -1); + const globalRootPath = execSync('npm root -g'); // Verify if the dependencies are available into the global _.forEach(strapiDependencies, (key) => { try { - const isInstalled = getInstalledPath.sync(key); + fs.accessSync(path.resolve(_.trim(globalRootPath.toString()), key), fs.constants.R_OK | fs.constants.F_OK); availableDependencies.push({ key, global: true, - path: isInstalled + path: path.resolve(_.trim(globalRootPath.toString()), key) }); } catch (e) { othersDependencies.push(key); diff --git a/packages/strapi-generate-new/package.json b/packages/strapi-generate-new/package.json index 01b0f8ce42..814d068472 100755 --- a/packages/strapi-generate-new/package.json +++ b/packages/strapi-generate-new/package.json @@ -15,7 +15,6 @@ "dependencies": { "enpeem": "^2.2.0", "fs-extra": "^4.0.0", - "get-installed-path": "^3.0.1", "inquirer": "^4.0.2", "lodash": "^4.17.4", "strapi-utils": "3.0.0-alpha.12.3",