diff --git a/lib/modules/manager/npm/post-update/npm.ts b/lib/modules/manager/npm/post-update/npm.ts
index aff424ee92a448b4a9b7cd811a16f8bf6f3f052f..d2587236de1bc44f3e3b06ce4a83642f6dd437af 100644
--- a/lib/modules/manager/npm/post-update/npm.ts
+++ b/lib/modules/manager/npm/post-update/npm.ts
@@ -174,7 +174,10 @@ export async function generateLockFile(
     // because npm install was called with an explicit version for rangeStrategy=update-lockfile
     if (lockUpdates.length) {
       const { detectedIndent, lockFileParsed } = parseLockFile(lockFile);
-      if (lockFileParsed?.lockfileVersion === 2) {
+      if (
+        lockFileParsed?.lockfileVersion === 2 ||
+        lockFileParsed?.lockfileVersion === 3
+      ) {
         lockUpdates.forEach((lockUpdate) => {
           const depType = lockUpdate.depType as
             | 'dependencies'