-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix: get node path from Windows registry, clearer error messages #5233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
Signed-off-by: V. Lascik <vlascik@users.noreply.github.com>
|
|
||
| // If this is a Stdio extension that uses npx, check for Node.js installation | ||
| #[cfg(target_os = "windows")] | ||
| use winreg::enums::{HKEY_LOCAL_MACHINE, KEY_READ}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great. does this mean we can delete the code in the API handler that tries to do the same thing? but only in the API so that would not work for the CLI I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what code do you mean? All I can see are some shell scripts trying to install node.js again in a default directory, which is probably not going to work for people that already have node installed elsewhere anyway (the chances are their install will just be updated).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean now, there is a new PR that moved this code to crates/goose-server/src/routes/agent.rs now, is this what you meant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah sorry I moved this - do you want to do that or should I just copy your code over if that is faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DOsinga just copy it, it will be faster.
|
/cc @jamadeo can we add this to your path magic or should it say separate |
|
Files moved around, so I did a new rebase of this PR at #5731 to make review/merge easier. |
Summary
On Windows when adding
npxextensions, Goose tries to findnode.exeat default paths inProgram Files, and then fails for everyone that installednodeelsewhere. This PR tries to also find the path from the registry, which should mitigate the problem for people that already have node installed, but in a different folder.Also the error messages are made a bit clearer about what the problem is, so that users can try to rectify it on their own.
The node.js install script doesn't seem to quite work, but that's left for another PR.
Type of Change
Testing
Build on Windows
Related Issues
Relates to #4030