{"id":13585,"library":"nave","title":"Nave: Node Virtual Environments","description":"Nave (Node Virtual Environments) is a command-line tool designed for managing multiple Node.js versions and their associated global npm package installations. It operates by spawning isolated subshells, allowing users to switch Node.js versions and their global npm environments on a per-session or per-project basis without permanently altering system-wide shell configurations like `.bashrc` or `.profile`. As of version 3.5.6, Nave functions primarily as a Bash script, differentiating it from Node.js-based version managers. Its installation can be achieved by simply downloading the `nave.sh` script or via a global npm installation, which essentially symlinks the script. The project's release cadence is irregular, reflecting maintainer-driven updates rather than a fixed schedule. A key advantage is its lightweight nature and reliance on standard shell features for environment isolation.","status":"active","version":"3.5.6","language":"javascript","source_language":"en","source_url":"https://github.com/isaacs/nave","tags":["javascript"],"install":[{"cmd":"npm install nave","lang":"bash","label":"npm"},{"cmd":"yarn add nave","lang":"bash","label":"yarn"},{"cmd":"pnpm add nave","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Nave is a Bash shell script and requires a Bash-compatible shell environment to execute its commands.","package":"bash","optional":false},{"reason":"Used for the recommended method of initially installing the `nave.sh` script by downloading it from GitHub.","package":"curl","optional":true}],"imports":[],"quickstart":{"code":"# Install nave by downloading the script (recommended for initial setup)\ncurl https://raw.githubusercontent.com/isaacs/nave/main/nave.sh > /usr/local/bin/nave\nchmod 0755 /usr/local/bin/nave\n\n# List available remote Node.js versions\nnave ls-remote\n\n# Install a specific Node.js version and automatically switch to a subshell using it\nnave use 18.17.1\n\n# Verify the active Node.js and npm versions within the subshell\nnode -v\nnpm -v\n\n# Install a global npm package within this specific Node.js environment\nnpm install -g yarn\n\n# Exit the nave subshell to revert to the previous Node.js environment\nexit\n\n# Install an LTS version under a named environment\nnave use my-project-env lts/hydrogen\n\n# Enter the named environment later\nnave use my-project-env\n\n# List locally installed Nave environments and versions\nnave ls","lang":"javascript","description":"This quickstart demonstrates the installation of the Nave shell script, listing remote Node.js versions, installing and switching to a specific version within a temporary subshell, installing a global npm package, and managing named Node.js environments. Note that these are shell commands, not JavaScript code, executed in the context of Node.js development."},"warnings":[{"fix":"Always remember that `nave use` creates a temporary environment. For persistent changes across all your terminal sessions, consider using `nave usemain <version>`, or for project-specific auto-switching, configure a `.naverc` file and use `nave auto`.","message":"Nave primarily operates by spawning a new subshell for each `nave use <version>` command. This means that changes to the Node.js version and global npm packages are scoped only to that subshell. Exiting the subshell (e.g., with `exit` or `^D`) will revert your environment to its state before `nave use` was called.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Understand that Nave's operations are command-line based shell functions. Its internal workings and troubleshooting are often related to shell environments (PATH, permissions, subshells) rather than Node.js module resolution or JavaScript execution.","message":"Although Nave can be installed via `npm install -g nave`, it is fundamentally a Bash shell script, not a Node.js library. Users accustomed to typical Node.js package interactions might find its shell-based nature and command-line interface distinct.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"If you intend for a Node.js version to be your default across all new terminal sessions, use `nave usemain <version>`. Be aware that this command may require `sudo` privileges depending on your system's `/usr/local` permissions.","message":"To establish a specific Node.js version as the 'main' system-wide version (i.e., modifying `/usr/local/bin` to point to a Nave-managed Node.js), you must explicitly use the `nave usemain <version>` command. Regular `nave use <version>` only affects the current subshell.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Continue using `npm install` or `yarn install` within your project directories after switching to a desired Node.js version with Nave to manage project-specific dependencies.","message":"Nave focuses exclusively on managing Node.js runtime versions and their associated global npm packages. It does not manage local project `node_modules` dependencies or `package.json` configurations. These aspects are handled by standard tools like `npm` or `yarn` within the activated Nave environment.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'3.5.6':70 'achiev':89 'advantag':126 'allow':34 'alter':57 'associ':23 'base':82 'bash':76 'bashrc':64 'basi':54 'cadenc':111 'command':12 'command-lin':11 'configur':62 'design':15 'differenti':78 'download':92 'driven':117 'environ':4,8,44,138 'essenti':103 'featur':136 'fix':122 'function':72 'global':24,42,99 'instal':27,86,101 'irregular':113 'isol':32,139 'javascript':140 'key':125 'lightweight':129 'like':63 'line':13 'maintain':116 'maintainer-driven':115 'manag':17,84 'multipl':18 'natur':130 'nave':1,5,71 'nave.sh':94 'node':2,6 'node.js':19,38,81 'npm':25,43,100 'oper':29 'packag':26 'per':48,52 'per-project':51 'per-sess':47 'perman':56 'primarili':73 'profil':66 'project':53,108 'rather':119 'reflect':114 'releas':110 'relianc':132 'schedul':123 'script':77,95,106 'session':49 'shell':61,135 'simpli':91 'spawn':31 'standard':134 'subshel':33 'switch':37 'symlink':104 'system':59 'system-wid':58 'tool':14 'updat':118 'user':35 'version':20,39,69,83 'via':97 'virtual':3,7 'wide':60 'without':55","created_at":"2026-04-20T01:55:15.763724+00:00","updated_at":"2026-04-20T01:55:15.763724+00:00","problems":[{"fix":"Ensure the `nave.sh` file (e.g., downloaded to `/usr/local/bin/nave`) has execute permissions (`chmod 0755 /usr/local/bin/nave`) and that its containing directory is included in your shell's PATH. If installed via npm, verify `npm bin -g` is in your PATH.","cause":"The `nave.sh` script is not located in a directory listed in your system's PATH environment variable, or it does not have execute permissions.","error":"nave: command not found"},{"fix":"If you want a Node.js version to be the default for all new terminal sessions, use `nave usemain <version>`. For project-specific, persistent environment switching, configure a `.naverc` file and use `nave auto`.","cause":"The `nave use <version>` command only creates a temporary subshell environment. When you `exit` that subshell, your terminal reverts to the Node.js version that was active before `nave use` was called.","error":"Node.js version is not X.Y.Z outside of the nave shell"},{"fix":"This often means the `npm` prefix within the Nave environment is incorrectly configured. Ensure `npm config get prefix` inside the `nave` subshell points to a user-owned directory within your Nave installation (e.g., `~/.nave/node/<version>/`). If not, you might need to reinstall the Node version via Nave, or manually configure the npm prefix using `npm config set prefix ~/.nave/node/$(nave get version)/lib/node_modules` (adjust path as necessary).","cause":"When attempting to install global npm packages within a `nave` environment, `npm` is trying to write to a system-owned directory (`/usr/local`) where your current user lacks write permissions.","error":"Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/npm'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"nave","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/isaacs/nave","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/nave","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-19","next_check":"2026-07-18","install_tag":null}}