Environment
vp env manages Node.js versions globally and per project.
Overview
Managed mode is on by default, so node, npm, and related shims resolve through Vite+ and pick the right Node.js version for the current project.
By default, Vite+ stores its managed runtime and related files in ~/.vite-plus. If needed, you can override that location with VITE_PLUS_HOME.
If you want to keep that behavior, run:
bash
vp env onThis enables managed mode, where the shims always use the Vite+-managed Node.js installation.
If you do not want Vite+ to manage Node.js first, run:
bash
vp env offThis switches to system-first mode, where the shims prefer your system Node.js and only fall back to the Vite+-managed runtime when needed.
Commands
Setup
vp env setupcreates or updates shims inVITE_PLUS_HOME/binvp env onenables managed mode so shims always use Vite+-managed Node.jsvp env offenables system-first mode so shims prefer system Node.js firstvp env printprints the shell snippet for the current session
Manage
vp env defaultsets or shows the global default Node.js versionvp env pinpins a Node.js version in the current directoryvp env unpinremoves.node-versionfrom the current directoryvp env usesets a Node.js version for the current shell sessionvp env installinstalls a Node.js versionvp env uninstallremoves an installed Node.js versionvp env execruns a command with a specific Node.js version
Inspect
vp env currentshows the current resolved environmentvp env doctorruns environment diagnosticsvp env whichshows which tool path will be usedvp env listshows locally installed Node.js versionsvp env list-remoteshows available Node.js versions from the registry
Project Setup
- Pin a project version with
.node-version - Use
vp install,vp dev, andvp buildnormally - Let Vite+ pick the right runtime for the project
Examples
bash
# Setup
vp env setup # Create shims for node, npm, npx
vp env on # Use Vite+ managed Node.js
vp env print # Print shell snippet for this session
# Manage
vp env pin lts # Pin the project to the latest LTS release
vp env install # Install the version from .node-version or package.json
vp env default lts # Set the global default version
vp env use 20 # Use Node.js 20 for the current shell session
vp env use --unset # Remove the session override
# Inspect
vp env current # Show current resolved environment
vp env current --json # JSON output for automation
vp env which node # Show which node binary will be used
vp env list-remote --lts # List only LTS versions
# Execute
vp env exec --node lts npm i # Execute npm with latest LTS
vp env exec node -v # Use shim mode with automatic version resolution