Skip to content

[Issue]: NPM commands give error: 11: exec: node: not found #1153

Closed

Description

@tragicrich

What happened?

I have been battling an issue for months where I am unable to get NVM / Node to work on my desktop (works fine on my other machine).

Error from any repo running an npm command: 11: exec: node: not found

Via powershell I ran nvm debug "no problems detected"
I can run nvm -v, node -v, npm -v and get proper version results

C:\Program Files\nodejs is a symlink created by the exe that shows the current node files
My environment variables have %NVM_HOME% and %NVM_SYMLINK% with proper paths, and no other conflicting paths for nodejs

I have uninstalled node / nvm multiple times and reinstalled and continue to get the same error.
I have run nvm on
I have run Powershell / CMD with Administrative Priveleges
I have scoured Stack Overflow and tried any and all recommendations from both accepted answers and other suggested comments

I am unable to determine why npm commands are not working. Everything returns a correct result until I run an actual command.

The differences from my other machine are:

  1. My desktop is Win 64bit
  2. My development files are on D:\

I am losing my mind on this and would like to be able to develop on my main machine again. Any help is greatly appreciated.

What did you expect to happen?

When running an npm command, my desktop should use the chosen version installed via NVM and should not give a "node not found" error.

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 11+

Which locale?

English (Default)

Which shell are you running NVM4W in?

Command Prompt, PowerShell

User Permissions?

Administrative Privileges, Elevated

Is Developer Mode enabled?

Yes

Relevant log/console output

11: exec: node: not found

Debug Output

Administrator: Windows PowerShell
NVM4W Version:      1.1.11
NVM4W Path:         C:\Users\<user>\AppData\Roaming\nvm\nvm.exe
NVM4W Settings:     C:\Users\<user>\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\<user>\AppData\Roaming\nvm
NVM_SYMLINK:        C:\Program Files\nodejs
Node Installations: C:\Users\<user>\AppData\Roaming\nvm

Active Node.js Version: v19.9.0

No problems detected.

Anything else?

No response

Activity

  1. coreybutler commented on Jul 9, 2024

    @coreybutler
    Collaborator

    I'm sorry you're going through this. That sounds frustrating.

    The first thing I'd suggest is reviewing any .npmrc files in your repos. This can change how npm behaves and where it looks for the node binary. Dotfiles can often be outdated, especially if they're not committed to git repos.

    In the "unlikely, but still possible" category, are you installing NVM4WW with a forked version? This is very important because there was recently a fork that added junction support over the default symlink behavior. This is known to fail on hard drives that are not used for the installation (i.e. your D:\).

    Additionally, did C:\Program Files\nodejs exist before the installation, or was it created manually? If it existed before the installation, the symlink would never be correctly generated when running nvm use 19.9.0 You can easily resolve this by deleting C:\Program Files\nodejs and re-running nvm use 19.9.0... just make sure C:\Program Files\nodejs is a symlink and not an old version of Node (otherwise you'll nuke the old version). This would be pretty unlikely though, unless a prior install of v19.9.0 existed when NVM4W was installed.

    Hopefully one of these things will lead you to an answer. If not, let me know.

    Since I don't think this is a bug, I'm going to move it to a discussion.

  2. locked and limited conversation to collaborators on Jul 9, 2024
  3. converted this issue into a discussion #1154 on Jul 9, 2024
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