Skip to content

Windows installer adds a malformed Node.js entry to PATH #66357

Description

@nikita-kiselev-dev

Version

24.21.0

Platform

After installing Node.js with the Windows installer, I found a malformed entry in the system `PATH`:


;C:\Program Files\nodejs


It has a trailing double quote, so it does not point to the Node.js installation directory. The correct entry should be:


C:\Program Files\nodejs\


When a process inherits the malformed entry without the valid one, commands such as `npx` cannot be resolved, even though `npx.cmd` is present in the installation directory.

### Steps to reproduce

1. Install Node.js using the Windows installer.
2. Inspect the system `PATH`.
3. Check whether it contains `;C:\Program Files\nodejs`.
4. With that entry in the process `PATH`, run `where.exe npx`.

### Actual result

`where.exe npx` cannot find `npx`, although `C:\Program Files\nodejs\npx.cmd` exists.

### Expected result

The installer should add the correct Node.js directory to `PATH` without a trailing quote.

Subsystem

No response

What steps will reproduce the bug?

  • Check path settings in Windows settings.

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

C:\Program Files\nodejs

What do you see instead?

;C:\Program Files\nodejs

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions