diff --git a/lib/manager/npm/post-update/index.js b/lib/manager/npm/post-update/index.js index ddf21b6bdb3321e06c7d3f5a74e0521d7ebad9e6..07ba883b100c6407c7ea9c0580b3455a32285ddd 100644 --- a/lib/manager/npm/post-update/index.js +++ b/lib/manager/npm/post-update/index.js @@ -182,7 +182,10 @@ async function writeExistingFiles(config, packageFiles) { const { npmLock } = packageFile; if (npmLock) { const npmLockPath = upath.join(config.tmpDir.path, npmLock); - if (config.updateType === 'lockFileMaintenance') { + if ( + process.env.RENOVATE_REUSE_PACKAGE_LOCK === 'false' || + config.updateType === 'lockFileMaintenance' + ) { logger.debug(`Ensuring ${npmLock} is removed`); await fs.remove(npmLockPath); } else {