turbo: [turborepo] `npx @turbo/codemod update` throws an error

What version of Turborepo are you using?

1.8.1

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Describe the Bug

after running npx @turbo/codemod@latest update --force :

WARNING: Git directory is not clean. Forcibly continuing...
? Where is the root of the repo to migrate? .
No codemods required to migrate from 1.8.1 to 1.8.3

Upgrading turbo from 1.8.1 to 1.8.3 (no codemods required)

Upgrading turbo with pnpm install turbo@latest --save-dev -w


Unexpected error. Please report it as a bug:
Error: Command failed: pnpm install turbo@latest --save-dev -w
    at checkExecSyncError (node:child_process:871:11)
    at execSync (node:child_process:943:15)
    at Command.N (/Users/i/.npm/_npx/36146fcc85b26196/node_modules/@turbo/codemod/dist/cli.js:4:8282)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.parseAsync (/Users/i/.npm/_npx/36146fcc85b26196/node_modules/commander/lib/command.js:935:5) {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer e2 80 89 45 52 52 5f 50 4e 50 4d 5f 48 4f 49 53 54 5f 50 41 54 54 45 52 4e 5f 44 49 46 46 e2 80 89 20 54 68 69 73 20 6d 6f 64 75 6c 65 73 20 64 69 72 ... 112 more bytes>,
    <Buffer >
  ],
  pid: 23255,
  stdout: <Buffer e2 80 89 45 52 52 5f 50 4e 50 4d 5f 48 4f 49 53 54 5f 50 41 54 54 45 52 4e 5f 44 49 46 46 e2 80 89 20 54 68 69 73 20 6d 6f 64 75 6c 65 73 20 64 69 72 ... 112 more bytes>,
  stderr: <Buffer >
}

Expected Behavior

no error

To Reproduce

Try the same command I suppose? npx @turbo/codemod@latest update --force

Reproduction Repo

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 19 (5 by maintainers)

Most upvoted comments

I believe the cause of this issue is very well known and the fix shouldn’t be hard to implement.

pnpm does not support the install command as a way to install or update/upgrade a package. install is aimed to work as with yarn where it only refers to the initial installation that takes no package as an argument.

Thus it is not:

pnpm install turbo@latest --save-dev -w

but

pnpm add turbo@latest --save-dev -w

or also (I think but haven’t tried)

pnpm up turbo@latest --latest -w

Same here, looks like missing an existence check for pnpm and yarn binaries?

image

@tknickman will your PR support yarn v3?

PR is up to fix this! Apologies for the (longgg) delay here.

Mine is 7.28.0