A Node.js version manager designed specifically for Steam Deck's read-only file system.
- 🚀 Auto-switching: Automatically switches Node.js versions based on
.nvmrcfiles when opening terminals or changing directories - 📦 Auto-install: Prompts to automatically install missing versions when you try to use them
- 🏷️ LTS identification: Clearly marks LTS versions with their codenames (Iron, Hydrogen, Gallium, etc.)
- 🔧 Easy setup/removal: One-command installation and removal with automatic environment reloading
- 💾 Steam Deck optimized: Works perfectly with Steam Deck's read-only file system
The Steam Deck uses a read-only file system, which makes installing the original NVM complicated and potentially risky. This lightweight Python-based alternative provides the same essential functionality without needing to modify system files.
Why Python? Python comes pre-installed on Steam Deck and is accessible through Konsole, making this solution simple and safe to use.
This tool works by adding a simple configuration to your .bashrc file:
if [ -f ~/node/current_used_version ]; then
NODE_VERSION=$(<~/node/current_used_version)
export PATH="$HOME/node/node-v${NODE_VERSION}-linux-x64/bin:$PATH"
fi
alias nvm="python {getcwd()}/nvm.py"
# Auto-switch Node.js version based on .nvmrc when changing directories
nvm_auto_use() {
if [ -f .nvmrc ]; then
python {getcwd()}/nvm.py auto
fi
}
# Hook into cd command to auto-detect .nvmrc
cd() {
builtin cd "$@"
nvm_auto_use
}
# Auto-detect .nvmrc when terminal starts (only for interactive shells)
if [[ $- == *i* ]]; then
nvm_auto_use
fiHere's what happens:
- Version tracking: Creates a file that stores your currently active Node.js version
- Automatic PATH setup: When you open a terminal, it reads the current version and adds Node.js binaries to your PATH
- Convenient alias: Adds an
nvmcommand that you can use from anywhere
The configuration is wrapped in comments so it can be cleanly removed later if needed.
This NVM includes convenient scripts that handle everything automatically:
setup.sh- Installs NVM and makes it immediately available in your current terminalremove.sh- Completely removes NVM from your system
Both scripts automatically reload your environment, so you never need to manually restart your terminal or run source commands.
- Download and extract this tool to any folder you like
- Open Konsole and navigate to the folder
- Run the setup script:
./setup.shThat's it! The script will:
- Configure your
.bashrcfile automatically - Start a fresh terminal session with NVM ready to use
- No manual steps required!
Manual installation: If you prefer, you can run python setup.py instead, but you'll need to restart your terminal or run source ~/.bashrc afterward.
Once installed, you can use all the standard NVM commands to manage Node.js versions:
nvm -a
# or
nvm availableShows all Node.js versions you can install. Features:
- LTS versions are clearly marked with their codename (e.g., "LTS: Iron", "LTS: Hydrogen")
- Installed versions are marked with a left arrow
← (installed)if you have the latest version of that major series installed
nvm install 20.18.3 # Install a specific version
nvm install latest # Install the latest version
nvm install lts # Install the latest LTS versionVersions are downloaded to ~/node directory.
nvm -l
# or
nvm listShows all Node.js versions currently installed on your system.
nvm use 20.18.3 # Switch to a specific version
nvm use latest # Switch to latest installed version
nvm use lts # Switch to latest LTS installed version
nvm use # Auto-detect and use version from .nvmrc fileAuto-install feature: If you try to use a version that isn't installed, NVM will ask if you'd like to install it automatically:
nvm use 18.20.4
# Version 18.20.4 not found.
# Would you like to install Node.js 18.20.4? (y/N): y
# Installing Node.js 18.20.4...
# Now using version number 18.20.4This works with both explicit versions and .nvmrc files, making it easy to get up and running in any project without manual installation steps.
.nvmrc support: Create a .nvmrc file in your project directory containing just the version number (like 20.18.3 or v20.18.3). When you run nvm use without arguments, it will automatically use the version specified in the .nvmrc file.
Automatic version switching: NVM automatically detects and switches Node.js versions in two scenarios:
- On terminal startup: When you open a new terminal, if there's a
.nvmrcfile in the current directory, NVM automatically switches to that version - When changing directories: When you
cdinto a directory with a.nvmrcfile, NVM automatically switches to that version
If the required version isn't installed, NVM will offer to install it automatically with your confirmation.
nvm remove 20.18.3 # Remove a specific version
nvm remove latest # Remove the latest version
nvm remove lts # Remove the latest LTS versionNote: The latest and lts keywords always refer to the current latest/LTS versions from nodejs.org. If you installed a version when it was "latest" but it's no longer the latest, you may need to remove it by its specific version number.
nvm -h
# or
nvm helpShows help for all available commands.
nvm auto # Manually check and switch to .nvmrc versionAutomatic detection: NVM provides seamless automatic version switching:
- Terminal startup: When you open a new terminal, if there's a
.nvmrcfile in the current directory, NVM automatically switches to that version - Directory navigation: When you
cdinto a directory with a.nvmrcfile, NVM automatically switches to that version - Auto-install: If the required version isn't installed, NVM will offer to install it automatically with your confirmation
Manual detection: You can also manually trigger version detection:
nvm auto # Manually check and switch to .nvmrc versionCreate a .nvmrc file in your project root with just the Node.js version:
20.18.3
or with the 'v' prefix:
v20.18.3
Example workflow:
- Create
.nvmrcin your project:echo "20.18.3" > .nvmrc - Navigate to your project directory - NVM automatically detects the version and offers to install it if needed
- Accept installation when prompted, and you're ready to go!
- Future visits to the directory will automatically switch to the correct version
Seamless development: Once set up, you never need to manually switch Node.js versions again. Just navigate to your projects and NVM handles everything automatically.
To completely remove NVM from your Steam Deck:
./remove.shThis will:
- Remove all NVM configuration from your
.bashrcfile - Start a fresh terminal session with NVM completely removed
- Clean removal with no manual steps required!
Manual removal: You can also run python setup.py remove if you prefer, but you'll need to restart your terminal or run source ~/.bashrc afterward.
Note: This only removes the NVM tool itself. If you want to delete your installed Node.js versions too, manually delete the ~/node directory.
If you encounter any problems:
- Make sure the scripts are executable: Run
chmod +x setup.sh remove.sh - Check you're in the right directory: The scripts need to be run from the folder where you extracted NVM
- Try manual installation: If the scripts don't work, try
python setup.pyinstead
For other issues, please create an issue on this project's GitHub repository.