Open leerob opened 1 month ago
for some reason, it's not realizing that bunx
is not bun
Running
bunx @next/codemod@latest next-async-request-api .
bunx @next/codemod@canary upgrade latest
both give this error on my machine:
node:internal/modules/cjs/loader:1147
throw err;
^
Error: Cannot find module '.bin/jscodeshift'
Require stack:
- C:\Users\[redacted]\AppData\Local\Temp\bunx-1560605942-@next\codemod@latest\node_modules\@next\codemod\bin\transform.js
- C:\Users\[redacted]\AppData\Local\Temp\bunx-1560605942-@next\codemod@latest\node_modules\@next\codemod\bin\upgrade.js
- C:\Users\[redacted]\AppData\Local\Temp\bunx-1560605942-@next\codemod@latest\node_modules\@next\codemod\bin\next-codemod.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Function.resolve (node:internal/modules/helpers:187:19)
at Object.<anonymous> (C:\Users\[redacted]\AppData\Local\Temp\bunx-1560605942-@next\codemod@latest\node_modules\@next\codemod\bin\transform.js:21:41)
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)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (C:\Users\[redacted]\AppData\Local\Temp\bunx-1560605942-@next\codemod@latest\node_modules\@next\codemod\bin\upgrade.js:38:21) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\[redacted]\\AppData\\Local\\Temp\\bunx-1560605942-@next\\codemod@latest\\node_modules\\@next\\codemod\\bin\\transform.js',
'C:\\Users\\[redacted]\\AppData\\Local\\Temp\\bunx-1560605942-@next\\codemod@latest\\node_modules\\@next\\codemod\\bin\\upgrade.js',
'C:\\Users\\[redacted]\\AppData\\Local\\Temp\\bunx-1560605942-@next\\codemod@latest\\node_modules\\@next\\codemod\\bin\\next-codemod.js'
]
}
Node.js v20.11.1
running bunx --bun @next/codemod@canary upgrade latest
gives
error: Cannot find module '.bin/jscodeshift' from 'C:\Users\[redacted]\AppData\Local\Temp\bunx-1560605942-@next\codemod@canary\node_modules\@next\codemod\bin\transform.js'
Bun v1.1.33 (Windows x64)
using bun 1.1.33+247456b67
, on Microsoft Windows NT 10.0.22631.0 x64 (Windows 11 Pro 23H2)
Hey, I'm also running into issues with @next/codemod on Bun. I'm on Windows 11 Pro and tried both 1.1.35 Canary and 1.1.34 - no luck. Works fine with pnpm and npm though.
I tried pretty much every Bun command I could think of:
bun i @next/codemod
and ran codemod x
But nope, same error every time. Any ideas what I'm doing wrong here? Would love to get this working with Bun.
What version of Bun is running?
1.1.30+7996d06b8
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
npx @next/codemod@canary upgrade rc
orbunx
versionbunx codemod@latest react/19/migration-recipe --no-interactive
directly:Strangely, it works for a coworker who is also on bun 1.1.30 and macOS with
Darwin 23.6.0 arm64 arm
.What is the expected behavior?
The codemod runs as expected.
What do you see instead?
No response
Additional information
No response