Loading

Quipoin Menu

Learn • Practice • Grow

node-js / Installing Node.js
interview

Q1. How do you install Node.js on Windows?
Go to the official Node.js website (nodejs.org) and download the Windows installer (.msi file). Run the installer and follow the setup wizard, which includes npm automatically. After installation, open Command Prompt and verify with node --version and npm --version. You can choose between LTS (long-term support) or Current version.

Q2. How do you install Node.js on macOS?
On macOS, you can download the macOS installer from nodejs.org, or use package managers. With Homebrew: brew install node. This installs both Node.js and npm. Alternatively, use the official .pkg installer. After installation, verify with terminal commands: node -v and npm -v.

Q3. How do you install Node.js on Linux?
On Linux, you can use package managers. For Ubuntu/Debian: sudo apt update && sudo apt install nodejs npm. Or use NodeSource repository for specific versions. For CentOS/RHEL: use EPEL or NodeSource. Alternatively, use nvm (Node Version Manager) for more flexibility in managing multiple Node.js versions.

Q4. What is nvm and why use it?
nvm (Node Version Manager) is a tool that allows you to install and manage multiple versions of Node.js on the same system. It's useful when working on different projects that require different Node.js versions. You can easily switch between versions with nvm use . It's available for Unix-like systems and Windows via nvm-windows.

Q5. How do you verify Node.js installation?
After installation, open terminal/command prompt and run: node --version (or node -v) to see the Node.js version. Run npm --version (or npm -v) to verify npm installation. You can also run a simple command: node -e "console.log('Hello Node')" to test if Node.js is working correctly.