npm Scripts & Workspaces/Create a new workspace

Create a workspace and update the root workspaces list.

Section: Workspace basics

Create a new workspace

bash
bash
npm init -w packages/app -y
Explanation

Create a workspace and update the root workspaces list.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Workspace basics
Run script in one workspace
Run a script for one specific workspace.
OpenIn sheetbashsame section
Include workspace root
Run scripts in workspaces and the root package.
OpenIn sheetbashsame section
Install all workspace dependencies
Run install across all configured workspaces.
OpenIn sheetbashsame section
Run script in all workspaces
Run a script in all workspaces.
OpenIn sheetbashsame section
Run a named script
Run a package.json script.
OpenIn sheetbash1 tag match
Run a binary from a package
Run a local binary inside the project context.
OpenIn sheetbash1 tag match