diff --git a/.changeset/strong-colts-hang.md b/.changeset/strong-colts-hang.md new file mode 100644 index 000000000..90b822b41 --- /dev/null +++ b/.changeset/strong-colts-hang.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fix "Cannot read properties of null" error in CLI code diff --git a/packages/astro/src/cli/telemetry/index.ts b/packages/astro/src/cli/telemetry/index.ts index dffb18bd9..fd664fcc9 100644 --- a/packages/astro/src/cli/telemetry/index.ts +++ b/packages/astro/src/cli/telemetry/index.ts @@ -9,7 +9,7 @@ interface TelemetryOptions { } export async function notify() { - const packageManager = (await whichPm(process.cwd())).name ?? 'npm'; + const packageManager = (await whichPm(process.cwd()))?.name ?? 'npm'; await telemetry.notify(() => { console.log(msg.telemetryNotice(packageManager) + '\n'); return true;