commitizen / cz-cli

The commitizen command line utility. #BlackLivesMatter

Home Page:http://commitizen.github.io/cz-cli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PNPM support is broken

thelinuxlich opened this issue · comments

Running commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact gives me this output:

Attempting to initialize using the npm package cz-conventional-changelog
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

npm ERR! A complete log of this run can be found in: /home/thelinuxlich/.npm/_logs/2024-05-20T13_29_22_244Z-debug-0.log
Error: Command failed: npm install cz-conventional-changelog --save-dev
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

npm ERR! A complete log of this run can be found in: /home/thelinuxlich/.npm/_logs/2024-05-20T13_29_22_244Z-debug-0.log

    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at init (/usr/local/lib/node_modules/commitizen/dist/commitizen/init.js:1017:28)
    at Object.bootstrap (/usr/local/lib/node_modules/commitizen/dist/cli/commitizen.js:34:30)
    at Object.<anonymous> (/usr/local/lib/node_modules/commitizen/bin/commitizen.js:2:38)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12) {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 6e 70 6d 20 45 52 52 21 20 63 6f 64 65 20 45 55 4e 53 55 50 50 4f 52 54 45 44 50 52 4f 54 4f 43 4f 4c 0a 6e 70 6d 20 45 52 52 21 20 55 6e 73 75 70 70 ... 162 more bytes>
  ],
  pid: 9285,
  stdout: <Buffer >,
  stderr: <Buffer 6e 70 6d 20 45 52 52 21 20 63 6f 64 65 20 45 55 4e 53 55 50 50 4f 52 54 45 44 50 52 4f 54 4f 43 4f 4c 0a 6e 70 6d 20 45 52 52 21 20 55 6e 73 75 70 70 ... 162 more bytes>
}

I installed commitizen locally inside the repository and then ran the initialization with: pnpm dlx commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact and it worked just fine.

pnpm version: 9.1.3

Was it a monorepo?

Yeah just a single repository with a single package.json file. No nxor lerna involved.

So you had dependencies with workspace on the root folder and it still worked?

Yes, that‘s correct.

Oh wait, you used pnpm dlx

Yes, its the same as pnpx. As stated above I have installed commitizen as a project devDependency and not as a global package.

@thelinuxlich Did you manage to get it up and running? If so, I guess we should close this issue. 😄