We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
npm prune
1 parent 58a0a3b commit f2b8f43Copy full SHA for f2b8f43
1 file changed
lib/dependency-manager-adapters/npm.js
@@ -104,7 +104,15 @@ module.exports = CoreObject.extend({
104
105
return this.run(cmd, [].concat(['install'], mgrOptions), { cwd: this.cwd }).then(() => {
106
if (!adapter.useYarnCommand) {
107
- return adapter.run(adapter.configKey, ['prune'], { cwd: adapter.cwd });
+ return adapter.run('npm', ['--version'], { cwd: this.cwd, stdio: 'pipe' }).then((res) => {
108
+ let version = res.stdout;
109
+ if (version.match(/^4./)) {
110
+ debug('Running npm prune because version is %s', version);
111
+ return adapter.run(adapter.configKey, ['prune'], { cwd: adapter.cwd });
112
+ }
113
+
114
+ debug('Not running npm prune because version is %s', version);
115
+ })
116
}
117
});
118
},
0 commit comments