oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.26k stars 2.69k forks source link

"bun add husky" fails with __internal__deprecationWarning #5916

Open stepaniukm opened 1 year ago

stepaniukm commented 1 year ago

What version of Bun is running?

1.0.3

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

Be inside monorepo. Run here bun add husky.

What is the expected behavior?

No bug and correct installation of the package.

What do you see instead?

bun i husky
bun add v1.0.3 (25e69c71)
 + api@workspace:packages/api
 + nuxt-app@workspace:packages/web

 installed husky@8.0.3 with binaries:
  - husky

 ERROR  Cannot redefine property: __internal__deprecationWarning                                                                                                                                5:50:17 PM

  at Function.defineProperty (<anonymous>)
  at Object.<anonymous> (/Users/mateuszstepaniuk/Projekty/rechelp/app/node_modules/@babel/types/lib/index.js:66:8)
  at Module._compile (node:internal/modules/cjs/loader:1241:14)
  at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
  at Module.load (node:internal/modules/cjs/loader:1091:32)
  at Module._load (node:internal/modules/cjs/loader:938:12)
  at Module.require (node:internal/modules/cjs/loader:1115:19)
  at require (node:internal/modules/helpers:130:18)
  at Object.<anonymous> (/Users/mateuszstepaniuk/Projekty/rechelp/app/node_modules/@babel/types/lib/builders/validateNode.js:8:14)
  at Module._compile (node:internal/modules/cjs/loader:1241:14)

 ERROR  Cannot redefine property: __internal__deprecationWarning                                                                                                                                5:50:17 PM

 2 packages installed [86.00ms]

Additional information

Why exactly node get's called here? Turns out that error went away when I bumped Node.js version from 20.6 to 20.7, could somebody clarify why is even Node.js called here?

nektro commented 3 months ago

does this still reproduce for you? it appears to be working on my end in Bun 1.1.10 (you may need to run bun upgrade) both with bun add husky and a fresh bun install