[BUG]: Unable to run "npm" after "vfox use nodejs" in Git Bash

Offen
#36 6 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
50/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
nodejs, shell
Bereich
tooling

Rechercherichtung

The report names the install directory nodejs/ under the vfox temp path, where npm is a shell script and npm.cmd is a Windows batch shim. Reproduce on Windows in Git Bash with vfox use nodejs and compare which npm against npm.cmd, then find where the plugin's Lua hooks put that directory on PATH. Done when npm --version works in Git Bash after vfox use nodejs.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

invalid

Version
vfox 0.5.3 (installed using scoop)
OS
Windows 11

Describe the bug
After running vfox use nodejs in Git Bash, I can execute node, but I get a "No such file or directory" error if I try to execute npm. After looking inside the directory mentioned in the error message, I did find that if I instead run npm.cmd, it works.

Example

$ vfox use nodejs
Please select a version of nodejs:
  -> 20.13.1
Now using [email protected].
$ node --version
v20.13.1
$ npm --version
/bin/bash: C:/Users/colec/.version-fox/temp/1716613200-1047/nodejs/npm: No such file or directory
$ ls -al /c/Users/colec/.version-fox/temp/1716613200-1047/nodejs/
total 67896
drw-rw-rw-  3 colec 0     4096 2024-05-25 21:58 .
drw-rw-rw-  3 colec 0        0 2024-05-25 21:58 ..
-rw-rw-rw-  1 colec 0    55087 2024-05-25 21:58 CHANGELOG.md
-rw-rw-rw-  1 colec 0      334 2024-05-25 21:58 corepack
-rwxrwxrwx  1 colec 0      218 2024-05-25 21:58 corepack.cmd
-rwxrwxrwx  1 colec 0     3033 2024-05-25 21:58 install_tools.bat
-rw-rw-rw-  1 colec 0   119618 2024-05-25 21:58 LICENSE
-rwxrwxrwx  1 colec 0 69266072 2024-05-25 21:58 node.exe
drw-rw-rw-  4 colec 0        0 2024-05-25 21:58 node_modules
-rwxrwxrwx  1 colec 0      702 2024-05-25 21:58 nodevars.bat
-rw-rw-rw-  1 colec 0     2073 2024-05-25 21:58 npm
-rwxrwxrwx  1 colec 0      538 2024-05-25 21:58 npm.cmd
-rw-rw-rw-  1 colec 0     2073 2024-05-25 21:58 npx
-rwxrwxrwx  1 colec 0      538 2024-05-25 21:58 npx.cmd
-rw-rw-rw-  1 colec 0    39557 2024-05-25 21:58 README.md
$ npm.cmd --version
10.5.2
Vorherrschende Sprache
Go
Sterne
10
Forks
8
Ø Merge
1 Std. 51 Min.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus version-fox/vfox-nodejs

Alle Issues in version-fox/vfox-nodejs

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.