Node.js Installation Guide
This guide provides all the key information and getting-started instructions after a successful Node.js installation via DeploySage-CLI. This installer uses NVM (Node Version Manager) to provide a flexible development environment.
Installation Information
Below are the details for your new Node.js environment.
| Item | Value |
|---|---|
| Node.js Version | e.g., v20.19.0 |
| npm Version | e.g., 10.8.2 |
| NVM Root Directory | $HOME/.nvm |
| Environment File | $HOME/.bashrc |
Activate Environment
NVM (Node Version Manager) Commands
Node.js and npm Commands
To start using Node.js, you must first source the environment file in your current terminal session, or simply open a new terminal.
NVM allows you to manage multiple Node.js versions easily.
Once your environment is active, you can use the standard Node.js and npm commands.
# Activate for the current session
source ~/.bashrc
# List all installed versions
nvm ls
# List all available remote versions
nvm ls-remote
# Switch to a different version (for current session)
nvm use v18.20.8
# Set a default version (for new sessions)
nvm alias default v20.19.0
# Install another version
nvm install 18
# Check versions
node -v
npm -v
# Initialize a new project
npm init
# Install a package
npm install express
# Run a script
node server.js