Node JS (Yarn)

Package manager: yarn

Framework
Node JS (Yarn)
Category
Languages
Publisher
Jetify
{
  "packages": ["nodejs@latest"],
  "env": {
    "DEVBOX_COREPACK_ENABLED": "true"
  },
  "shell": {
    "init_hook": [
      "yarn install"
    ],
    "scripts": {
      "run_test": "yarn 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 Devbox.sh

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 Yarn as your Package Manager

devbox add yarn, or in your devbox.json add:

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

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

Checkout the Devbox and Launchpad open-source codebases on Github. Feature requests are always welcome.
Try Devbox Cloud
YOUR INPUT COUNTS

Join the community

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