Open Leksat opened 6 days ago
Also, it was a surprise that nodePackages.pnpm
came with its own Node.js. I was expecting it to use nodejs
I defined in packages. Are there any docs about this?
Would it help to add a callout-visual element that says Use Corepack to install yarn or pnpm. Enabling Corepack will introduce the yarn and pnpm binaries into your shell environment that work with your version of nodejs specified via
devbox add.
?
Also, it was a surprise that nodePackages.pnpm came with its own Node.js.
Yes, this is because Devbox relies on Nix packages, which are designed to be reproducibly installed and run. To achieve this, each nix package specifies the specific versions of their dependencies. When nodePackages.pnpm@latest
is installed it will install the specific version of nodejs that this latest
version was defined as depending on.
For me, the text that I have found in the code would work better, maybe a little rephrased:
You can install Yarn or Pnpm by adding them to the
packageManager
field of yourpackage.json
.
And maybe an addition:
See the example repositories below.
What problem are you trying to solve?
https://www.jetify.com/devbox/docs/devbox_examples/languages/nodejs/ suggests using
DEVBOX_COREPACK_ENABLED
to get a desired package manager. Also, at the bottom of the page there is another example:Reading this page, I created my
devbox.json
as follows:And was quite confused to see this behavior:
I have found what I was doing wrong after reading some source code. (No idea how I got there π ) https://github.com/jetify-com/devbox/blob/d1ab6416fbe86682b56a28bf2fb4159e7af2ba70/plugins/nodejs.json#L5
What solution would you like?
I know there are links to example repos on the docs page. But it would make it much easier to follow if
"packageManager"
field is mentioned directly on the docs page πAlternatives you've considered
Close this issue and let the newcomers struggle π