npm install [package...]

Install a package and its dependencies

Arguments

NameDescription
package

Options

NameDescription
-P, --save-prodPackage will appear in your `dependencies`. This is the default unless `-D` or `-O` are present
-D, --save-devPackage will appear in your `devDependencies`
-O, --save-optionalPackage will appear in your `optionalDependencies`
--no-savePrevents saving to `dependencies`
-E, --save-exactSaved dependencies will be configured with an exact version rather than using npm's default semver range operator
-B, --save-bundleSaved dependencies will also be added to your bundleDependencies list
-g, --globalOperates in 'global' mode, so that packages are installed into the prefix folder instead of the current working directory
--global-styleCauses npm to install the package into your local node_modules folder with the same layout it uses with the global node_modules folder
--legacy-bundlingCauses npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, can install the package
--legacy-peer-depsBypass peerDependency auto-installation. Emulate install behavior of NPM v4 through v6
--strict-peer-depsIf set to true, and --legacy-peer-deps is not set, then any conflicting peerDependencies will be treated as an install failure
--no-package-lockIgnores package-lock.json files when installing
--omit <Package type>
  • Repeatable ♾
  • Repeatable 3x
--ignore-scriptsIf true, npm does not run scripts specified in package.json files
--no-auditSubmit audit reports alongside the current npm command to the default registry and all registries configured for scopes
--no-bin-linksTells npm to not create symlinks (or .cmd shims on Windows) for package executables
--no-fundHides the message at the end of each npm install acknowledging the number of dependencies looking for funding
--dry-runIndicates that you don't want npm to make any changes and that it should only report what it would have done
-w, --workspace <workspace...>Enable running a command in the context of the configured workspaces of the current project
-ws, --workspacesEnable running a command in the context of all the configured workspaces