Skip to content

Commit 71413d1

Browse files
authored
Update nodejs README.md to include corepack (#1928)
## Summary ## How was it tested? Signed-off-by: Lucille Hua <[email protected]>
1 parent 8171595 commit 71413d1

File tree

1 file changed

+11
-5
lines changed
  • examples/development/nodejs/nodejs-pnpm

1 file changed

+11
-5
lines changed

examples/development/nodejs/nodejs-pnpm/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,21 @@ This will install NodeJS 18, and comes bundled with `npm`. You can find other in
1818

1919
## Adding pnpm as your Package Manager
2020

21-
`devbox add nodePackages@pnpm`, or in your `devbox.json` add:
21+
We recommend using Corepack to install and manage your Node Package Manager in Devbox. Corepack comes bundled with all recent Nodejs versions, and you can tell Devbox to automatically configure Corepack using a built-in plugin. When enabled, corepack binaries will be installed in your project's .devbox directory, and automatically added to your path.
22+
23+
To enable Corepack, set DEVBOX_COREPACK_ENABLED to true in your devbox.json:
2224

2325
```json
24-
"packages": [
25-
"nodejs@18",
26-
27-
],
26+
{
27+
"packages": ["nodejs@18"],
28+
"env": {
29+
"DEVBOX_COREPACK_ENABLED": "true"
30+
}
31+
}
2832
```
2933

34+
To disable Corepack, remove the DEVBOX_COREPACK_ENABLED variable from your devbox.json
35+
3036
## Installing Global Packages
3137

3238
In some situations, you may want to install packages using `npm install --global`. This will fail in Devbox since the Nix Store is immutable.

0 commit comments

Comments
 (0)