From f2462578e43041421e2a24b29dd9d010a401f2b1 Mon Sep 17 00:00:00 2001 From: cburgos Date: Mon, 11 Feb 2019 22:06:32 -0500 Subject: [PATCH] package-lock.json no longer created when there is no package.json --- lib/shrinkwrap.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/shrinkwrap.js b/lib/shrinkwrap.js index dbb12b5bd4fba..9dd7bcacf69a7 100644 --- a/lib/shrinkwrap.js +++ b/lib/shrinkwrap.js @@ -196,6 +196,11 @@ function save (dir, pkginfo, opts, cb) { checkPackageFile(dir, PKGLOCK), checkPackageFile(dir, 'package.json'), (shrinkwrap, lockfile, pkg) => { + if (!pkg) { + // If no pkg, do not continue with package-lock + cb(null, pkginfo) + return + } const info = ( shrinkwrap || lockfile ||