diff --git a/packages/nx/src/plugins/js/index.ts b/packages/nx/src/plugins/js/index.ts index e338685e6b43c..5898c83bc1079 100644 --- a/packages/nx/src/plugins/js/index.ts +++ b/packages/nx/src/plugins/js/index.ts @@ -38,7 +38,7 @@ export const createNodes: CreateNodes = [ combineGlobPatterns(LOCKFILES), (lockFile, context) => { const pluginConfig = jsPluginConfig(context.nxJsonConfiguration); - if (!pluginConfig.analyzePackageJson) { + if (!pluginConfig.analyzeLockfile) { return {}; } @@ -83,7 +83,7 @@ export const createDependencies: CreateDependencies = ( let lockfileDependencies: ProjectGraphDependencyWithFile[] = []; // lockfile may not exist yet if ( - pluginConfig.analyzePackageJson && + pluginConfig.analyzeLockfile && lockFileExists(packageManager) && parsedLockFile ) { diff --git a/packages/nx/src/plugins/js/lock-file/lock-file.ts b/packages/nx/src/plugins/js/lock-file/lock-file.ts index 513078ea916f4..f2ec5549ab7ef 100644 --- a/packages/nx/src/plugins/js/lock-file/lock-file.ts +++ b/packages/nx/src/plugins/js/lock-file/lock-file.ts @@ -76,7 +76,7 @@ export function getLockFileNodes( bodyLines: errorBodyLines(e), }); } - return; + throw e; } throw new Error(`Unknown package manager: ${packageManager}`); } @@ -107,7 +107,7 @@ export function getLockFileDependencies( bodyLines: errorBodyLines(e), }); } - return; + throw e; } throw new Error(`Unknown package manager: ${packageManager}`); }