Aspire.Hosting.JavaScript - WithPnpm fails when using Scoop-installed pnpm
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
When using the new `AddJavaScriptApp` and `WithPnpm` with `Aspire.Hosting.JavaScript` version `13.1.2`, the resource fails to start with pnpm installed via the Scoop package manager on Windows 11.
My `AppHost.cs` contains the following, according to [the release notes of v13](https://aspire.dev/whats-new/aspire-13/#refactored-addnodeapp-api):
```cs
builder
.AddJavaScriptApp(name: "frontend", appDirectory: "./MyProject.Web")
.WithPnpm();
```
Upon executing `aspire run`, the `frontend` resource starts along the `frontend-installer`, but the later fails:
The logs indicate an error starting the pnpm process:
```txt
Executing command 'resource-start'.
Successfully executed command 'resource-start'.
[sys] Starting process...: Cmd = C:\Users\pBouillon\scoop\shims\pnpm.exe, Args = ["install"]
[sys] Failed to start a process: Cmd = C:\Users\pBouillon\scoop\shims\pnpm.exe, Args = ["install"], Error = fork/exec C:\Users\pBouillon\scoop\shims\pnpm.exe: The directory name is invalid.
[sys] Failed to start Executable: Error = fork/exec C:\Users\pBouillon\scoop\shims\pnpm.exe: The directory name is invalid.
```
However, pnpm is indeed installed at this location, and works fine from the terminal:
### Expected Behavior
The resource should successfully execute the pnpm install command via the shim or correctly resolve the path to the actual binary.
### Steps To Reproduce
Here is the minimal reproduction repository: https://github.com/pBouillon/aspire-pnpm-bug-report
To experience the same issue, you will also need to install pnpm through package manager, [scoop](https://scoop.sh/) in my case, and:
- run `aspire run`
- open the dashboard
- observe the `frontend-installer` resource failing
### Exceptions (if any)
_No response_
### .NET Version info
.NET SDK:
Version: 10.0.102
Commit: 4452502459
Workload version: 10.0.100-manifests.6d969a7e
MSBuild version: 18.0.7+445250245
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.102\
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 10.0.2
Architecture: x64
Commit: 4452502459
.NET SDKs installed:
10.0.100 [C:\Program Files\dotnet\sdk]
10.0.102 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
### Anything else?
pnpm info from scoop:
```
> scoop which pnpm
~\scoop\apps\pnpm\current\pnpm.exe
> scoop info pnpm
Name : pnpm
Description : A fast and disk space efficient Node package manager.
Version : 10.30.3
Source : main
Website : https://pnpm.io
License : MIT
Updated at : 2026-02-26 13:33:25
Updated by : github-actions[bot]
Installed : 10.30.3
Binaries : pnpm.exe | pnpx.exe
```
Contributor guide
Assessment
This issue has not been assessed yet.