From 9518dcb4027f2fb01fcd9185d8e74384663ed4b5 Mon Sep 17 00:00:00 2001 From: Victor Repkow Date: Wed, 10 Feb 2021 10:23:39 -0500 Subject: [PATCH] fix(updater): npm7 package lock's inner version not being updated --- 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) }