-
Notifications
You must be signed in to change notification settings - Fork 552
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
PNPM support is broken #994
Comments
I installed commitizen locally inside the repository and then ran the initialization with: pnpm version: |
Was it a monorepo? |
Yeah just a single repository with a single |
So you had dependencies with workspace on the root folder and it still worked? |
Yes, that‘s correct. |
Oh wait, you used |
Yes, its the same as |
@thelinuxlich Did you manage to get it up and running? If so, I guess we should close this issue. 😄 |
Neither of the global $ pnpm dlx commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact
Attempting to initialize using the npm package cz-conventional-changelog
Error: Command failed: pnpm add cz-conventional-changelog --save-dev
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at checkExecSyncError (node:child_process:890:11)
at Object.execSync (node:child_process:962:15)
at init (/home/ian/.cache/pnpm/dlx/n6ucavohe6yfg2cemixhqeizvi/1921f4c6513-112422/node_modules/.pnpm/commitizen@4.3.0_@types+node@22.5.5_typescript@5.6.2/node_modules/commitizen/dist/commitizen/init.js:1024:28)
at Object.bootstrap (/home/ian/.cache/pnpm/dlx/n6ucavohe6yfg2cemixhqeizvi/1921f4c6513-112422/node_modules/.pnpm/commitizen@4.3.0_@types+node@22.5.5_typescript@5.6.2/node_modules/commitizen/dist/cli/commitizen.js:30:30)
at Object.<anonymous> (/home/ian/.cache/pnpm/dlx/n6ucavohe6yfg2cemixhqeizvi/1921f4c6513-112422/node_modules/.pnpm/commitizen@4.3.0_@types+node@22.5.5_typescript@5.6.2/node_modules/commitizen/bin/commitizen.js:2:38)
at Module._compile (node:internal/modules/cjs/loader:1378:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
at Module.load (node:internal/modules/cjs/loader:1212:32) {
status: 1,
signal: null,
output: [
null,
<Buffer e2 80 89 45 52 52 5f 50 4e 50 4d 5f 41 44 44 49 4e 47 5f 54 4f 5f 52 4f 4f 54 e2 80 89 20 52 75 6e 6e 69 6e 67 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 ... 302 more bytes>,
<Buffer >
],
pid: 1125243,
stdout: <Buffer e2 80 89 45 52 52 5f 50 4e 50 4d 5f 41 44 44 49 4e 47 5f 54 4f 5f 52 4f 4f 54 e2 80 89 20 52 75 6e 6e 69 6e 67 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 ... 302 more bytes>,
stderr: <Buffer >
} It seems to be caused by this: when we try to install a package at the root of a pnpm workspace it requires us to add the For example: pnpm add -D commitizen
ERR_PNPM_ADDING_TO_ROOT Running this command will add the dependency to the workspace root, which might not be what you want - if you really meant it, make it explicit by running this command again with the -w flag (or --workspace-root). If you don't want to see this warning anymore, you may set the ignore-workspace-root-check setting to true. When I disable this check by adding It would be great to be able to better support this case instead of crashing. I could have a look at it if you want. |
This is caused by the pnpm workspace root check. A viable workaround:
For the maintainers, as Ianlet has pointed out - this is caused by pnpm rejecting package installations to a monorepo root by default. The I think the following is contradicting, and might be confusing the package/repository maintainers.
Tobi states they only have a single |
@Mirasaki Thank you, it works, but end of the work Another workaround is by manually install:
{
"path": "cz-conventional-changelog"
} Or config in package.json "config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
}
|
Running
commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact
gives me this output:The text was updated successfully, but these errors were encountered: