File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
packages/angular/cli/src/commands/update Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -716,12 +716,16 @@ export async function supplementWithLocalDependencies(
716716 ...localManifest . peerDependencies ,
717717 } ;
718718
719+ const projectRequire = createRequire ( path . join ( projectRoot , 'package.json' ) ) ;
720+
719721 for ( const depName of Object . keys ( localDeps ) ) {
720722 if ( dependencies . has ( depName ) ) {
721723 continue ;
722724 }
723- const pkgJsonPath = findPackageJson ( projectRoot , depName ) ;
724- if ( ! pkgJsonPath ) {
725+ let pkgJsonPath : string ;
726+ try {
727+ pkgJsonPath = projectRequire . resolve ( `${ depName } /package.json` ) ;
728+ } catch {
725729 continue ;
726730 }
727731 const installed = await readPackageManifest ( pkgJsonPath ) ;
@@ -744,14 +748,3 @@ async function readPackageManifest(manifestPath: string): Promise<PackageManifes
744748 return undefined ;
745749 }
746750}
747-
748- function findPackageJson ( workspaceDir : string , packageName : string ) : string | undefined {
749- try {
750- const projectRequire = createRequire ( path . join ( workspaceDir , 'package.json' ) ) ;
751- const packageJsonPath = projectRequire . resolve ( `${ packageName } /package.json` ) ;
752-
753- return packageJsonPath ;
754- } catch {
755- return undefined ;
756- }
757- }
You can’t perform that action at this time.
0 commit comments