obsidian-github-copilot icon indicating copy to clipboard operation
obsidian-github-copilot copied to clipboard

Node not recognized on windows

Open JKamsker opened this issue 9 months ago • 6 comments

Describe the bug

  • default cannot be found
  • C:\Program Files\nodejs\node.exe: Image
  • "C:\Program Files\nodejs\node.exe" Image

To Reproduce Steps to reproduce the behavior:

  1. Use windows
  2. 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

JKamsker avatar Mar 19 '25 13:03 JKamsker

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

acherrera avatar Mar 21 '25 14:03 acherrera

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

JKamsker avatar Mar 21 '25 14:03 JKamsker

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

Glinte avatar Apr 18 '25 07:04 Glinte

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:

toxfu avatar May 01 '25 04:05 toxfu

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

0xMonad avatar May 09 '25 09:05 0xMonad

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.

riatzukiza avatar Jul 30 '25 02:07 riatzukiza