From a316dd02f5a7d8dee33d99370afda8738985bc10 Mon Sep 17 00:00:00 2001 From: Victor Repkow Date: Wed, 14 Jul 2021 14:11:54 -0400 Subject: [PATCH] fix(updater): npm7 package lock's inner version not being updated (#713) --- lib/updaters/types/json.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/updaters/types/json.js b/lib/updaters/types/json.js index 4494aab76..fdc2a8907 100644 --- a/lib/updaters/types/json.js +++ b/lib/updaters/types/json.js @@ -11,6 +11,12 @@ module.exports.writeVersion = function (contents, version) { const indent = detectIndent(contents).indent const newline = detectNewline(contents) json.version = version + + if (json.packages && json.packages['']) { + // package-lock v2 stores version there too + json.packages[''].version = version + } + return stringifyPackage(json, indent, newline) }