Skip to content

Commit 2dd9136

Browse files
authored
fix(cli): ionic info returns package information (#4991)
Resolves #4992
1 parent d753f69 commit 2dd9136

File tree

1 file changed

+2
-2
lines changed
  • packages/@ionic/cli/src/lib/project

1 file changed

+2
-2
lines changed

packages/@ionic/cli/src/lib/project/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ export abstract class Project implements IProject {
508508
let pkgPath: string | undefined;
509509

510510
try {
511-
pkgPath = pkgName ? require.resolve(`${pkgName}/package`, { paths: compileNodeModulesPaths(this.directory) }) : this.packageJsonPath;
511+
pkgPath = pkgName ? require.resolve(`${pkgName}/package.json`, { paths: compileNodeModulesPaths(this.directory) }) : this.packageJsonPath;
512512
pkg = await readPackageJsonFile(pkgPath);
513513
} catch (e: any) {
514514
if (logErrors) {
@@ -521,7 +521,7 @@ export abstract class Project implements IProject {
521521

522522
async requirePackageJson(pkgName?: string): Promise<PackageJson> {
523523
try {
524-
const pkgPath = pkgName ? require.resolve(`${pkgName}/package`, { paths: compileNodeModulesPaths(this.directory) }) : this.packageJsonPath;
524+
const pkgPath = pkgName ? require.resolve(`${pkgName}/package.json`, { paths: compileNodeModulesPaths(this.directory) }) : this.packageJsonPath;
525525
return await readPackageJsonFile(pkgPath);
526526
} catch (e: any) {
527527
if (e instanceof SyntaxError) {

0 commit comments

Comments
 (0)