You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI: TypeScript AppHost hardcodes npm install, ignoring packageManager field #16121
The Aspire CLI hardcodes npm install as the dependency installation command for TypeScript AppHosts (TypeScriptLanguageSupport.GetRuntimeSpec()), ignoring the packageManager field in the project's package.json.
This causes failures in yarn/pnpm monorepos where:
npm install can take 60+ seconds in large monorepos, exceeding the AppHost startup timeout
npm install fails with Invalid Version: errors when run against a yarn-managed node_modules directory
Even with --no-build, the CLI still runs npm install
Reproduction
Run aspire init in a yarn monorepo with "packageManager": "yarn@1.22.22" in package.json
Run aspire start
Observe the CLI runs npm.CMD install instead of yarn install
From the logs: [GuestAppHostProject] Executing: C:\Program Files\nodejs\npm.CMD install [AppHost] npm error Invalid Version: [GuestAppHostProject] TypeScript (Node.js) apphost exited with code 1
Root Cause
TypeScriptLanguageSupport.GetRuntimeSpec() in src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptLanguageSupport.cs:249-253:
I tried to repro this on macOS arm64 with Node 24.3.0 / npm 11.4.2 / Corepack 0.34.7, using PATH wrappers for npm, yarn, and pnpm so I could see the exact executable invoked.
I can't reproduce the hardcoded npm install behavior on either 13.4.6 (13.4.6+87fe259e) or current main (13.6.0-dev, 9b79ab5):
With the reported packageManager: "yarn@1.22.22" + yarn.lock shape, both CLIs fail before install with Yarn Classic is not supported for TypeScript AppHosts...; no package-manager process was invoked.
With a pnpm monorepo (packageManager: "pnpm@10.30.1" + pnpm-lock.yaml), both CLIs invoked pnpm install --ignore-workspace. --no-build still invokes install, but it was still pnpm, not npm.
With supported Yarn (packageManager: "yarn@4.9.2" + yarn.lock, and aspire-apphost included in the workspaces list), both CLIs invoked yarn install.
Lockfile/module behavior also matched the selected toolchain in my repros: pnpm used aspire-apphost/pnpm-lock.yaml + node_modules, Yarn 4 used .pnp.cjs / .yarn + yarn.lock, and I didn't see a package-lock.json get created.
So I think the hardcoded-npm install part is no longer reproing in current stable/main. The Yarn Classic case still doesn't work, but it now fails as unsupported instead of falling through to npm.
Activity
adamint commentedon Aug 10, 2026
I tried to repro this on macOS arm64 with Node 24.3.0 / npm 11.4.2 / Corepack 0.34.7, using PATH wrappers for
npm,yarn, andpnpmso I could see the exact executable invoked.I can't reproduce the hardcoded
npm installbehavior on either 13.4.6 (13.4.6+87fe259e) or current main (13.6.0-dev, 9b79ab5):packageManager: "yarn@1.22.22"+yarn.lockshape, both CLIs fail before install withYarn Classic is not supported for TypeScript AppHosts...; no package-manager process was invoked.packageManager: "pnpm@10.30.1"+pnpm-lock.yaml), both CLIs invokedpnpm install --ignore-workspace.--no-buildstill invokes install, but it was stillpnpm, notnpm.packageManager: "yarn@4.9.2"+yarn.lock, andaspire-apphostincluded in the workspaces list), both CLIs invokedyarn install.Lockfile/module behavior also matched the selected toolchain in my repros: pnpm used
aspire-apphost/pnpm-lock.yaml+node_modules, Yarn 4 used.pnp.cjs/.yarn+yarn.lock, and I didn't see apackage-lock.jsonget created.So I think the hardcoded-
npm installpart is no longer reproing in current stable/main. The Yarn Classic case still doesn't work, but it now fails as unsupported instead of falling through to npm.