commitizen / commitizen/cz-cli

path resolve failed on MSYS2+zsh environment

Offen
#823 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
17.5k
Forks
566
Ø Merge
8 Std. 16 Min.
Gemergte PRs (30 T.)
1

Beschreibung

OS Version: Windows 10 ver 1909 (18363.1500)
node version: v14.10.0
npm version: v6.14.8

In my situation, I installed msys2 & zsh on Windows, and I use zsh as my shell. My Node.JS is Windows version.

When I use commitizen, it fails in resolve the path for `cz-conventional-changelog`.

In my `package.json`
```json
{
...
"scripts": {
"commit": "git-cz"
},
"devDependencies": {
"commitizen": "^4.2.3"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
...
}
```

When I use `npm run commit`, it gives:
```bash
$ npm run commit

> update-vue2-vite@1.0.0 commit E:\Projects\Github\boxsnake\update-vue2-vite
> git-cz

Could not resolve E:\e\Projects\Github\boxsnake\update-vue2-vite\node_modules\cz-conventional-changelog. Cannot find module 'E:\e\Projects\Github\boxsnake\update-vue2-vite\node_modules\cz-conventional-changelog'
Require stack:
- E:\Projects\Github\boxsnake\update-vue2-vite\node_modules\_commitizen@4.2.3@commitizen\dist\commitizen\adapter.js
- E:\Projects\Github\boxsnake\update-vue2-vite\node_modules\_commitizen@4.2.3@commitizen\dist\commitizen.js
- E:\Projects\Github\boxsnake\update-vue2-vite\node_modules\_commitizen@4.2.3@commitizen\dist\cli\git-cz.js
- E:\Projects\Github\boxsnake\update-vue2-vite\node_modules\_commitizen@4.2.3@commitizen\bin\git-cz.js
- E:\Projects\Github\boxsnake\update-vue2-vite\node_modules\_commitizen@4.2.3@commitizen\bin\git-cz
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! update-vue2-vite@1.0.0 commit: `git-cz`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the update-vue2-vite@1.0.0 commit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! D:\Programs\nodejs\global\cache\_logs\2021-04-25T16_03_44_621Z-debug.log
```

PS. When I use `node -e 'console.log(process.cwd())'` in zsh environment, it gives Windows formatted path:
```bash
$ node -e 'console.log(process.cwd());'
E:\Projects\Github\boxsnake\update-vue2-vite
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere den Fehler mit Node.js unter Windows mit MSYS2 und zsh anhand der Konfiguration in package.json und mit npm run commit. Beginne bei dist/commitizen/adapter.js, wobei die git-cz-Einstiegspunkte im Stack als Kontext dienen, und vergleiche den Windows-Pfad aus process.cwd() mit dem aufgelösten Adapterpfad. Abgeschlossen ist die Aufgabe, wenn cz-conventional-changelog in dieser Umgebung aufgelöst wird und die Commit-Abfrage startet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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