[Windows] laravel new fails with "npm isn't installed" when using NVM (Author Software\nvm)

Open
#145 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, rust
Domain
backend, cli

Research direction

Start by reading the Rust CLI's Windows code that checks for npm and launches it; the issue does not name a file or test, so locate those entry points first. Reproduce the failure in PowerShell with NVM, then check whether npm detection or process launch rejects its executable path. Done when laravel new proceeds past the npm check with this setup and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Description

Laravel Installer Version

Latest (Rust CLI binary via php.new)

Operating System

Windows 11 / PowerShell

Description

When running laravel new <project-name> in PowerShell on Windows and selecting Rust (or any option that checks for npm), the installer immediately fails with:

✘ npm isn't installed; install Node.js from https://nodejs.org

However, both node and npm are properly installed via NVM (Author Software\nvm), present in the system/user PATH, and work normally in PowerShell and cmd.exe.

Steps To Reproduce
  1. Install Node.js and npm on Windows using NVM (C:\Users\<user>\AppData\Local\Author Software\nvm).
  2. Verify that node -v (v24.22.3), npm -v (12.2.3), rustc --version (1.100.1), and git --version (2.56.1) all work properly in PowerShell.
  3. Run laravel new laravel-rust in PowerShell.
  4. Select Rust when prompted for the language.
  5. The CLI fails immediately with npm isn't installed; install Node.js from https://nodejs.org.
Additional Context
  • where.exe npm resolves to C:\Users\<user>\AppData\Local\Author Software\nvm\.nodejs\npm.exe.
  • (Get-Command node).Source resolves to C:\Users\<user>\AppData\Local\Author Software\nvm\.nodejs\node.exe.
  • Even when placing a custom npm.exe shim at the very top of $env:PATH (e.g., in ~\.cargo\bin\npm.exe), the Laravel CLI never invokes it, suggesting it either resolves npm by inspecting the node.exe directory directly or fails to execute NVM's junction/shim executables on Windows.
Dominant language
Rust
Stars
2.2k
Forks
105
Avg merge
7h 19m
Merged PRs (30d)
41

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from laravel/rust

All issues in laravel/rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.