dev uses pkgx and shellcode to automatically, install and activate the
packages you need for different projects as you navigate in your shell.
Ensure you are using the same versions of tools for your entire stack, during
dev, across your team and in production.
Note
Packages are installed to ~/.pkgx and not available to your wider system
without using a tool from the pkgx tooling ecosystem.
Since dev v1.8.0 we integrate with pkgm (^0.11) and this is the recommended
way to use dev.
Important
Both dev and the packages you want to be dev-aware must be installed to
/usr/local/ for this to work. (dev (but only dev) can be a pkgm shim).
sudo pkgm install dev node@22$ cd my-project
$ ls
package.json
$ node --version
command not found: node
$ sudo pkgm install dev node
$ node --version && which node
v23.11.0
/usr/local/bin/node
$ cat package.json | jq .engines
{
"node": "^20"
}
$ dev .
activated `~/my-project` (+node^20)
$ node --version && which node
v20.19.0
/usr/local/bin/node
$ cd ..
$ node --version && which node
v23.11.0
/usr/local/bin/node
$ cd -
$ node --version && which node
v20.19.0
/usr/local/bin/nodepkgm installs dev-aware packages to /usr/local/bin. Provided you have
/usr/local/bin/dev installed and you have activated dev in your project
directories the node that is invoked is swapped out when invoked.
This is the recommended way to use dev because it works everywhere and not
just the terminal.