mirror of
https://github.com/strapi/strapi.git
synced 2025-12-29 08:04:51 +00:00
Merge pull request #2119 from strapi/fix/2011
Fix plugin install version
This commit is contained in:
commit
546f389746
@ -15,6 +15,9 @@ const shell = require('shelljs');
|
||||
// Logger.
|
||||
const { cli, logger, packageManager } = require('strapi-utils');
|
||||
|
||||
// Local Strapi dependencies.
|
||||
const packageJSON = require('../package.json');
|
||||
|
||||
/**
|
||||
* `$ strapi install`
|
||||
*
|
||||
@ -66,7 +69,7 @@ module.exports = function (plugin, cliArguments) {
|
||||
fs.writeFileSync(`${pluginPath}/package.json`, JSON.stringify({}), 'utf8');
|
||||
}
|
||||
|
||||
const cmd = isStrapiInstalledWithNPM ? `npm install ${pluginID}@alpha --ignore-scripts --no-save --prefix ${pluginPath}` : `yarn --cwd ${pluginPath} add ${pluginID}@alpha --ignore-scripts --no-save`;
|
||||
const cmd = isStrapiInstalledWithNPM ? `npm install ${pluginID}@${packageJSON.version} --ignore-scripts --no-save --prefix ${pluginPath}` : `yarn --cwd ${pluginPath} add ${pluginID}@${packageJSON.version} --ignore-scripts --no-save`;
|
||||
exec(cmd, (err) => {
|
||||
if (err) {
|
||||
logger.error(`An error occurred during plugin installation. \nPlease make sure this plugin is available on npm: https://www.npmjs.com/package/${pluginID}`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user