Node JS (PNPM)

Package manager: pnpm

Framework
Node JS (PNPM)
Category
Languages
Publisher
Jetify
{
  "packages": ["nodejs@latest"],
  "env": {
    "DEVBOX_COREPACK_ENABLED": "true"
  },
  "shell": {
    "init_hook": [
      "pnpm install"
    ],
    "scripts": {
      "run_test": "pnpm run start"
    }
  }
}

NodeJS

Most NodeJS Projects will install their dependencies locally using NPM or Yarn, and thus can work with Devbox with minimal additional configuration. Per project packages can be managed via NPM or Yarn.

Open In Devspace

Adding NodeJS to your Shell

devbox add nodejs, or in your devbox.json:

  "packages": [
    "nodejs@18"
  ],

This will install NodeJS 18, and comes bundled with npm. You can find other installable versions of NodeJS by running devbox search nodejs. You can also view the available versions on Nixhub

Adding pnpm as your Package Manager

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.

To enable Corepack, set DEVBOX_COREPACK_ENABLED to true in your devbox.json:

{
  "packages": ["nodejs@18"],
  "env": {
    "DEVBOX_COREPACK_ENABLED": "true"
  }
}

To disable Corepack, remove the DEVBOX_COREPACK_ENABLED variable from your devbox.json

Installing Global Packages

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

You can instead install these global packages by adding them to the list of packages in your devbox.json. For example: to add yalc and pm2:

{
    "packages": [
        "nodejs@18",
        "nodePackages.yalc@latest",
        "nodePackages.pm2@latest"
    ]
}
README.md

Level up your dev environment

No need to switch your style. Devbox works with any coding language, so you can get results as you write.
PREPARE FOR LAUNCH

Plans for teams of any size

Jetify Cloud offers pricing plans for Solo Developers to Large Enterprises, and everything in between. All plans include free credits, and you are only billed for what you use. Need something custom? Contact our team and we can help.
YOUR INPUT COUNTS

Join the community

Discuss ideas, uses and builds with the Jetify team and others.