From e4b97962e5fce0d49beb541ce5a0f96aee0525de Mon Sep 17 00:00:00 2001 From: Fighting-Jack <574637316@qq.com> Date: Wed, 20 Nov 2019 20:19:19 +0800 Subject: [PATCH] shrinkwrap: no need to read package.json when read shrinkwrap PR-URL: https://github.com/npm/cli/pull/504 Credit: @Lighting-Jack Close: #504 Reviewed-by: @mikemimik --- lib/install/read-shrinkwrap.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/install/read-shrinkwrap.js b/lib/install/read-shrinkwrap.js index 7074678011127..1d9fb99c1d807 100644 --- a/lib/install/read-shrinkwrap.js +++ b/lib/install/read-shrinkwrap.js @@ -19,8 +19,7 @@ function readShrinkwrap (child, next) { maybeReadFile('npm-shrinkwrap.json', child), // Don't read non-root lockfiles child.isTop && maybeReadFile('package-lock.json', child), - child.isTop && maybeReadFile('package.json', child), - (shrinkwrap, lockfile, pkgJson) => { + (shrinkwrap, lockfile) => { if (shrinkwrap && lockfile) { log.warn('read-shrinkwrap', 'Ignoring package-lock.json because there is already an npm-shrinkwrap.json. Please use only one of the two.') }