copilot.el
copilot.el copied to clipboard
Invalid package name
When trying to install the server I am greeted with an npm error.
/usr/bin/npm -g --prefix /home/casper/.config/emacs/.local/cache/.cache/copilot install copilot-node-server\@1.14.0
npm error code EINVALIDPACKAGENAME
npm error Invalid package name "copilot-node-server\" of package "copilot-node-server\@1.14.0": name can only contain URL-friendly characters.
npm error A complete log of this run can be found in: /home/casper/.npm/_logs/2024-07-01T14_06_46_512Z-debug-0.log
Comint exited abnormally with code 1 at Mon Jul 1 16:06:46
I can't help much here.
You may want to examine the shell-quote-argument and copilot-install-server functions to find out where the extra \ comes from.
I don't see from the source where it may appear from. The code seems fine, i.e.
"install" (format "%s@%s" copilot-server-package-name copilot-version)))
does not have an extra \. Could the @ symbol be automatically escaped?
what shell are you using, @cvanelteren ?
I wonder if this is some naive usage of the login shell by emacs. I ran into this myself, and I know I use a non-posix shell.
I did find that a perfectly okay workaround for this issue is to copy-paste the command into my own shell and run (without the incorrect backslash). Then emacs seems to have no problem picking up the new server binary and moving on with its life.
Using nushell (0.96.1).
I think the issue is with nushell, after copying the installation command to bash and running it there, the installation succeeded.
The installation command can be found when you run M-x copilot-install-server, it looks something like this:
path/to/your/npm -g --prefix path/to/your/emacs/config/.local/cache/.cache/copilot install copilot-node-server\@1.27.0