commitizen / commitizen/cz-cli

path resolve failed on MSYS2+zsh environment

Đang mở
#823 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
17.5k
Fork
566
Merge trung bình
8 giờ 16 phút
Pull request đã merge (30 ngày)
1

Mô tả

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
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.