Node not recognized on windows
Describe the bug
defaultcannot be found- C:\Program Files\nodejs\node.exe:
- "C:\Program Files\nodejs\node.exe"
To Reproduce Steps to reproduce the behavior:
- Use windows
- Try to set nodejs correctly
Expected behavior
-C:\Program Files\nodejs\node.exe should be escaped properly in the shell
"C:\Program Files\nodejs\node.exe"should be considered a root path
Obsidian and environment (please complete the following information):
- OS: Windows
- Obsidian version: The latest stable (No idea)
- Plugin version [e.g. 1.0.0] : The latest stable
Looks like the space in the first file path is causing the issue. If you move it to a path without spaces, does that fix it? I noticed my path doesn't have any spaces and it works.
Steps I Used
TLDR: actual location, no spaces, quotes or escaped backslashes
The steps I did that worked for those who find this issues later:
- Find filepath of node.
- shift + right-click => "copy as path"
- paste in a text editor
- remove single quotes
" - ensure only a single
\is used in the path - do not need to escape the backslash - copy and past into the Obsidian plugin.
Bad path:
"C:\\Users\\my_user\\Location With Space\\that\\might\\not\\exist\\node.exe"
Good path
C:\Users\my_user\AppData\Roaming\fnm\node-versions\v22.14.0\installation\node.exe
Looks like the space in the first file path is causing the issue. If you move it to a path without spaces, does that fix it? I noticed my path doesn't have any spaces and it works.
Yes, thats how i solved it for me: I created a directory symlink and used that. But the plugin should handle spaces correctly
My node.exe is in C:\Program Files\..., and moving the executable itself is a pretty bad idea, so I solved this by making a hard link mklink /H dest_path source_path
Use: C:\Progra~1\nodejs\node.exe instead of C:\Program Files\nodejs\node.exe Windows retains a "short" version of long names for compatibility:
Use: C:\Progra~1\nodejs\node.exe instead of C:\Program Files\nodejs\node.exe Windows retains a "short" version of long names for compatibility:
It works
Use: C:\Progra~1\nodejs\node.exe instead of C:\Program Files\nodejs\node.exe Windows retains a "short" version of long names for compatibility:
You beautiful bastard. Thanks.