diff --git a/lib/manager/npm/extract/index.js b/lib/manager/npm/extract/index.js index 2c2224f5a3a2453e660dbee397b3faaf08638210..90b0fd93147a0bd4d22a3f1cd439b885c2eaa236 100644 --- a/lib/manager/npm/extract/index.js +++ b/lib/manager/npm/extract/index.js @@ -95,6 +95,7 @@ async function extractDependencies(content, packageFile, config) { let lernaDir; let lernaPackages; let lernaClient; + let skipInstalls = true; const lernaJson = JSON.parse( await platform.getFile(upath.join(path.dirname(packageFile), 'lerna.json')) ); @@ -138,6 +139,7 @@ async function extractDependencies(content, packageFile, config) { } } else if (dep.currentValue.startsWith('file:')) { dep.skipReason = 'file'; + skipInstalls = false; } else if (semver.isValid(dep.currentValue)) { dep.purl = `pkg:npm/${depName.replace('@', '%40')}`; if (dep.currentValue === '*') { @@ -192,6 +194,7 @@ async function extractDependencies(content, packageFile, config) { lernaDir, lernaClient, lernaPackages, + skipInstalls, yarnWorkspacesPackages, }; } diff --git a/test/manager/npm/extract/__snapshots__/index.spec.js.snap b/test/manager/npm/extract/__snapshots__/index.spec.js.snap index 06582bb4bf3cfa6d0e4e4d9fd7f7a345b159bc12..6a384c9766526886ee408753063fac9213cea8fb 100644 --- a/test/manager/npm/extract/__snapshots__/index.spec.js.snap +++ b/test/manager/npm/extract/__snapshots__/index.spec.js.snap @@ -102,6 +102,7 @@ Object { "packageJsonType": "app", "packageJsonVersion": undefined, "pnpmShrinkwrap": undefined, + "skipInstalls": false, "yarnLock": undefined, "yarnWorkspacesPackages": undefined, "yarnrc": undefined, @@ -201,6 +202,7 @@ Object { "packageJsonType": "app", "packageJsonVersion": "1.0.0", "pnpmShrinkwrap": undefined, + "skipInstalls": true, "yarnLock": "yarn.lock", "yarnWorkspacesPackages": undefined, "yarnrc": undefined, @@ -219,6 +221,7 @@ Object { "packageJsonType": "app", "packageJsonVersion": "0.0.8", "pnpmShrinkwrap": undefined, + "skipInstalls": true, "yarnLock": undefined, "yarnWorkspacesPackages": Array [ "packages/*", @@ -320,6 +323,7 @@ Object { "packageJsonType": "app", "packageJsonVersion": "1.0.0", "pnpmShrinkwrap": undefined, + "skipInstalls": true, "yarnLock": undefined, "yarnWorkspacesPackages": undefined, "yarnrc": undefined, @@ -419,6 +423,7 @@ Object { "packageJsonType": "app", "packageJsonVersion": "1.0.0", "pnpmShrinkwrap": undefined, + "skipInstalls": true, "yarnLock": undefined, "yarnWorkspacesPackages": undefined, "yarnrc": undefined,