Initialize Project in NPM

From the NPM Package Manager cheat sheet ยท Project Setup & Initialization ยท verified Jul 2026

Initialize Project

Create a new package.json file

bash
# Interactive setup
npm init

# Quick setup with defaults
npm init -y

# Create with scope
npm init --scope=@mycompany

# Use create- starter
npm init react-app my-app
npm init vite@latest my-project

# Common init options
npm init -w packages/new-package  # In workspace
npm init --workspace=packages/api
๐ŸŸข Essential - Every project starts with npm init
๐Ÿ’ก Use -y flag to skip questions and use defaults
๐Ÿ“Œ npm init <pkg> runs npm exec create-<pkg>
โšก Set config defaults to save time
๐Ÿ”— Related: npm config for default settings
initsetup

Continue with NPM Package Manager

Save the full cheat sheet or work through every related task.

More NPM tasks

Back to the full NPM Package Manager cheat sheet