Closed sunnz closed 1 year ago
:tada: This issue has been resolved in version 4.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I'm still getting an error with pnpm on 4.3.0.
Attempting to initialize using the npm package cz-conventional-changelog
Error: Command failed: pnpm add cz-conventional-changelog --save-dev
at checkExecSyncError (node:child_process:871:11)
at Object.execSync (node:child_process:943:15)
at init (/Users/josh/Engineering/SvelteKit/lively/node_modules/.pnpm/commitizen@4.3.0/node_modules/commitizen/dist/commitizen/init.js:1024:28)
at Object.bootstrap (/Users/josh/Engineering/SvelteKit/lively/node_modules/.pnpm/commitizen@4.3.0/node_modules/commitizen/dist/cli/commitizen.js:30:30)
at Object.<anonymous> (/Users/josh/Engineering/SvelteKit/lively/node_modules/.pnpm/commitizen@4.3.0/node_modules/commitizen/bin/commitizen.js:2:38)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12) {
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: 40756,
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 >
}
I'm still getting an error with pnpm on 4.3.0.
Attempting to initialize using the npm package cz-conventional-changelog Error: Command failed: pnpm add cz-conventional-changelog --save-dev at checkExecSyncError (node:child_process:871:11) at Object.execSync (node:child_process:943:15) at init (/Users/josh/Engineering/SvelteKit/lively/node_modules/.pnpm/commitizen@4.3.0/node_modules/commitizen/dist/commitizen/init.js:1024:28) at Object.bootstrap (/Users/josh/Engineering/SvelteKit/lively/node_modules/.pnpm/commitizen@4.3.0/node_modules/commitizen/dist/cli/commitizen.js:30:30) at Object.<anonymous> (/Users/josh/Engineering/SvelteKit/lively/node_modules/.pnpm/commitizen@4.3.0/node_modules/commitizen/bin/commitizen.js:2:38) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) { 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: 40756, 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 > }
FWIW, I had this same error when trying to initialize Commitizen on a pnpm workspace.
You'll understand why it crashes if you try to run pnpm add cz-conventional-changelog --save-dev
manually: it complains about installing a package to the workspace root.
❯ pnpm add cz-conventional-changelog --save-dev
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.
A workaround for this was, indeed, to set the ignore-workspace-root-check
setting to true:
pnpm config set ignore-workspace-root-check true
Commitizen now initializes without any errors.
Tried this step but it still doesn't work. Anybody got it working?
Hey, the Google Gemini just produced this answer and it works perfectly well !!!
pnpm commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact
I had run the
commitizen init cz-conventional-changelog --save-dev --save-exact
command as per README, but it doesn't work, see a copy and paste of the error from commitizen at the end.Suggestion: when there exists a
pnpm-lock.yaml
file, use pnpm instead of npm.Here's my workaround:
Then add this block to the package.json file:
The
cz
command works as usual from this point.Error from
commitizen init cz-conventional-changelog --save-dev --save-exact
: