Skip to content
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

fix: pnpm commit execution error #4181

Open
4 tasks
limuen opened this issue Oct 15, 2024 · 6 comments
Open
4 tasks

fix: pnpm commit execution error #4181

limuen opened this issue Oct 15, 2024 · 6 comments
Labels

Comments

@limuen
Copy link

limuen commented Oct 15, 2024

Steps to Reproduce

1. pnpm commit
2. git add -A && czg && git push
3. czg@1.10.1

Directory import '/Users/limuen/Documents/github/React-Pro-Admin/node_modules/.pnpm/@commitlint+config-conventional@18.6.3/node_modules/@commitlint/config-conventional/lib' is not supported resolving ES modules imported from /Users/limuen/Documents/github/React-Pro-Admin/node_modules/.pnpm/@commitlint+config-conventional@18.6.3/node_modules/@commitlint/config-conventional/wrapper.mjs

 ELIFECYCLE  Command failed with exit code 1.

Current Behavior

No response

Expected Behavior

Normally, the option to commit lint.config should appear

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

No response

commitlint --version

18.6.3

git --version

2.39.3 (Apple Git-145)

node --version

20.10.0

@limuen limuen added the bug label Oct 15, 2024
@limuen limuen changed the title fix: <title> fix: pnpm commit execution error Oct 15, 2024
@limuen
Copy link
Author

limuen commented Oct 15, 2024

The project has been running for over a year, but recently I opened it and updated the dependencies, but I can't submit it

@escapedcat
Copy link
Member

Which pnpm version do you use now?
Here's an unmerged PR which is related to pnpm: #4019
Maybe this is related?

@limuen
Copy link
Author

limuen commented Oct 17, 2024

use pnpm 8.15.4

@LiuWenXing1996
Copy link

The project has been running for over a year, but recently I opened it and updated the dependencies, but I can't submit it

did you resolve this bug, I encountered a similar bug, I bypassed this bug by fallback @commitlint/prompt-cli version to 19.4.1

@limuen
Copy link
Author

limuen commented Oct 18, 2024

该项目已经运行了一年多,但最近我打开它并更新了依赖项,但我无法提交它

你解决了这个错误吗?我也遇到了类似的错误,我通过将 @commitlint/prompt-cli 版本回退到 19.4.1 来绕过这个错误

I can only manually enter the git command to submit now

@durianice
Copy link

durianice commented Nov 14, 2024

该项目已经运行了一年多,但最近我打开它并更新了依赖项,但我无法提交它

你解决了这个错误吗?我也遇到了类似的错误,我通过将 @commitlint/prompt-cli 版本回退到 19.4.1 来绕过这个错误

I can only manually enter the git command to submit now

同样的问题,我也是装了 18.6.3 这个版本的 @commitlint/config-conventional

不更新版本的情况下,我是这样解决的:

定位到项目相对路径 node_modules/@commitlint/config-conventional/wrapper.mjs

实际路径可能是 E:\yourworkspace\yourproject\node_modules\.pnpm\@commitlint+config-conventional@18.6.3\node_modules\@commitlint\config-conventional\wrapper.mjs

修改为以下内容,保存后再运行 pnpm commit

import pkg from './lib/index.js';
const { parserPreset, prompt, rules } = pkg;
export { parserPreset, prompt, rules };
export default pkg;

当然最好的方式是先暂时将版本锁定在 18.4.3 😋

"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants