githubEdit

codeNode.js

Node.js record

1. Development Environment

Install

# ubuntu
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs

# macOS
brew install node

# Verify
node -v
npm -v

nvm

Node Version Manager. A tool for managing multiple Node.js versions per user.

Install

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# Add to shell profile (auto-added by installer)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# Verify
nvm --version

Node Version Management

fnm

Fast Node Manager, written in Rust. A faster alternative to nvm with .nvmrc / .node-version support.

Install

Node Version Management

2. ProjectManage

npm

The default package manager bundled with Node.js. It uses package.json for dependency declaration and package-lock.json for lockfile.

Project Management

Configuration

Bun

An all-in-one JavaScript runtime and toolkit. It includes a bundler, test runner, and npm-compatible package manager — all significantly faster than Node.js equivalents.

Install

Project Management

pnpm

A fast, disk-efficient package manager. It uses a content-addressable store and hard links to save disk space.

Install

Project Management

Reference:

Last updated