NPM-INSTALL-TEST(1)
π npm-install-test(1): install package(s) and run tests π
πΈ NAME πΈ
npm-install-test β install package(s) and run tests. This is the npm-install-test(1) manual page, bestie. π
β¨ Synopsis β¨
npm install-test [<package-spec> ...]
alias: it
π«Ά Description π«Ά
Okay so this command is literally a combo move: it runs an npm install followed immediately by an npm test. It takes exactly the same arguments as npm install. No cap, that's the whole vibe. β¨
ποΈ Configuration ποΈ
Here come the config knobs, and yes, we are keeping every single one. π
saveβ saves installed packages to apackage.jsonfile as dependencies.- Default:
trueunless when usingnpm updatewhere it defaults tofalse - Type: Boolean
- Default:
When used with the npm rm command, removes the dependency from package.json.
Will also prevent writing to package-lock.json if set to false.
save-exactβ dependencies saved topackage.jsonwill be configured with an exact version rather than using npm's default semver range operator.- Default:
false - Type: Boolean
- Default:
globalβ operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. Seenpm help foldersfor more on the differences in behavior.- Default:
false - Type: Boolean
- packages are installed into the
{prefix}/lib/node_modulesfolder, instead of the current working directory. - bin files are linked to
{prefix}/bin - man pages are linked to
{prefix}/share/man
- Default:
install-strategyβ sets the strategy for installing packages innode_modules.- Default:
"hoisted" - Type:
"hoisted","nested","shallow", or"linked"
- Default:
hoisted (default): install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: install in node_modules/.store, link in place, unhoisted.
We recommend that package authors use --install-strategy=linked during development to catch undeclared ("phantom") dependencies before publishing: the isolated layout only exposes a package's declared dependencies, so an import of a package that was never added to package.json can fail instead of resolving by accident and shipping broken. See Catching undeclared ("phantom") dependencies β¨/using-npm/developers#catching-undeclared-phantom-dependenciesβ©.
legacy-bundlingβ instead of hoisting package installs innode_modules, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets--install-strategy=nested.- Default:
false - Type: Boolean
- DEPRECATED: This option has been deprecated in favor of
--install-strategy=nested
- Default:
global-styleβ only install direct dependencies in the top levelnode_modules, but hoist on deeper dependencies. Sets--install-strategy=shallow.- Default:
false - Type: Boolean
- DEPRECATED: This option has been deprecated in favor of
--install-strategy=shallow
- Default:
omitβ dependency types to omit from the installation tree on disk.- Default:
'dev'if theNODE_ENVenvironment variable is set to'production'; otherwise, empty. - Type:
"dev","optional", or"peer"(can be set multiple times)
- Default:
Note that these dependencies are still resolved and added to the package-lock.json file. They are just not physically installed on disk.
If a package type appears in both the --include and --omit lists, then it will be included.
If the resulting omit list includes 'dev', then the NODE_ENV environment variable will be set to 'production' for all lifecycle scripts.
includeβ option that allows for defining which types of dependencies to install. This is the inverse of--omit=<type>.- Default: β
- Type:
"prod","dev","optional", or"peer"(can be set multiple times)
Dependency types specified in --include will not be omitted, regardless of the order in which omit/include are specified on the command-line.
strict-peer-depsβ if set totrue, and--legacy-peer-depsis not set, then any conflictingpeerDependencieswill be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.- Default:
false - Type: Boolean
- Default:
By default, conflicting peerDependencies deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's peerDependencies object.
When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If --strict-peer-deps is set, then this warning is treated as a failure.
prefer-dedupeβ prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency.- Default:
false - Type: Boolean
- Default:
package-lockβ if set tofalse, then ignorepackage-lock.jsonfiles when installing. This will also prevent writingpackage-lock.jsonifsaveis true.- Default:
true - Type: Boolean
- Default:
package-lock-onlyβ if set totrue, the current operation will only use thepackage-lock.json, ignoringnode_modules.- Default:
false - Type: Boolean
- Default:
For update this means only the package-lock.json will be updated, instead of checking node_modules and downloading dependencies.
For list this means the output will be based on the tree described by the package-lock.json, rather than the contents of node_modules.
foreground-scriptsβ run all build scripts (ie,preinstall,install, andpostinstall) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.- Default:
falseunless when usingnpm packornpm publishwhere it defaults totrue - Type: Boolean
- Default:
Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging.
ignore-scriptsβ iftrue, npm does not run scripts specified inpackage.jsonfiles.- Default:
false - Type: Boolean
- Default:
Note that commands explicitly intended to run a particular script, such as npm start, npm stop, npm restart, npm test, and npm run will still run their intended script if ignore-scripts is set, but they will not run any pre- or post-scripts.
Setting ignore-scripts also disables .npm-extension execution, as if ignore-extension were set.
allow-directoryβ limits the ability for npm to install dependencies from directories. That is, dependencies that point to a directory instead of a version or semver range.- Default:
"all" - Type:
"all","none", or"root"
- Default:
Please note that this could leave your tree incomplete and some packages may not function as intended or designed. Changing this setting will not remove dependencies that are already installed.
all allows any directories to be installed. none prevents any directories from being installed. root only allows directories defined in your project's package.json to be installed. Also allows directory dependencies to be used for other commands like npm view.
allow-fileβ limits the ability for npm to install dependencies from tarball files. That is, dependencies that point to a local tarball file instead of a version or semver range.- Default:
"all" - Type:
"all","none", or"root"
- Default:
Please note that this could leave your tree incomplete and some packages may not function as intended or designed. Changing this setting will not remove dependencies that are already installed.
all allows any tarball file to be installed. none prevents any tarball file from being installed. root only allows tarball files defined in your project's package.json to be installed. Also allows tarball file dependencies to be used for other commands like npm view.
allow-gitβ limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range.- Default:
"none" - Type:
"all","none", or"root"
- Default:
Please note that this could leave your tree incomplete and some packages may not function as intended or designed. Changing this setting will not remove dependencies that are already installed.
As of npm 12 the default is none. Git dependencies run git against a remote repo and may install configuration the project does not control. Opt in explicitly per project (in .npmrc) or per command (on the CLI) when you need git deps.
all allows any git dependencies to be fetched and installed. none prevents any git dependencies from being fetched and installed. root only allows git dependencies defined in your project's package.json to be fetched and installed. Also allows git dependencies to be fetched for other commands like npm view.
allow-remoteβ limits the ability for npm to fetch dependencies from urls. That is, dependencies that point to a tarball url instead of a version or semver range.- Default:
"none" - Type:
"all","none", or"root"
- Default:
Please note that this could leave your tree incomplete and some packages may not function as intended or designed. Changing this setting will not remove dependencies that are already installed.
As of npm 12 the default is none. Tarballs that share a hostname with the configured registry (the typical case for the npm registry, GitHub Packages, and most private registries) are still installed normally. If your registry serves tarballs from a different host, set replace-registry-host or override this setting. Opt in explicitly per project (in .npmrc) or per command (on the CLI) when you intentionally install from a URL.
all allows any url to be installed. none prevents any url from being installed. root only allows urls defined in your project's package.json to be installed. Also allows url dependencies to be used for other commands like npm view.
allow-scriptsβ comma-separated list of packages whose install-time lifecycle scripts (preinstall,install,postinstall, andpreparefor non-registry dependencies) are allowed to run.- Default:
"" - Type: String (can be set multiple times)
- Default:
This setting is intended for one-off and global contexts: npm exec, npx, and npm install -g, where no project package.json is involved. For team-wide policy in a project, use the allowScripts field in package.json (which also supports explicit denials), or configure it in .npmrc. Passing --allow-scripts on the command line during a project-scoped npm install, ci, update, or rebuild is an error.
...and that identity check is against a dependency's resolved identity, not the package's self-reported name, okay? Also: --ignore-scripts and --dangerously-allow-all-scripts both override this setting, so don't come for the config when a flag steamrolls it.
Oh and bestie β this value is not exported to the environment for child processes. Keep that in mind before you go hunting for it in process.env. π
π¦ strict-allow-scripts
- Default:
false - Type:
Boolean
Set this to true and the install-script policy levels all the way up: it stops being a warning and becomes a hard error. So any dependency rocking install scripts that isn't covered by allowScripts will fail the install instead of just getting blocked with a warning. It's giving strict-parent energy and honestly? valid.
Little nuance that matters: deps you explicitly denied with false in allowScripts are always silently skipped β this setting only affects the unreviewed entries (packages with install scripts that are neither approved nor denied). And both --ignore-scripts and --dangerously-allow-all-scripts override this setting. π«Ά
Optional dependencies that can't be installed on the current platform or engine (a non-matching os, cpu, or libc) are not flagged, because their install scripts never run in the first place. Can't fail a script that never happens. π
π dangerously-allow-all-scripts
- Default:
false - Type:
Boolean
Set to true and you're bypassing the allowScripts policy entirely, running every dependency install script regardless of whether it was approved or denied. Yeah. That's why dangerously is literally in the name, bestie.
Intended as a migration escape hatch only. Its use is strongly discouraged. And --ignore-scripts still takes precedence over this setting, so even your chaos has a ceiling.
π audit
- Default:
true - Type:
Boolean
When true, npm submits audit reports alongside the current npm command β to the default registry and all registries configured for scopes. Wanna know exactly what gets sent? The docs for npm help audit have the details. Slay, transparency.
π
before
- Default:
null - Type:
nullorDate
If you pass this to npm install, npm rebuilds the tree so only versions that were available on or before the given date get installed. And if there are no versions available for the current set of dependencies? The command errors. No vibes-based guessing. π
If the version you asked for is a dist-tag and that tag doesn't pass the --before filter, then the most recent version less than or equal to that tag gets used. Example straight from the manpage: foo@latest might install foo@1.2 even though latest is 2.0. Iconic behavior, honestly.
Now the precedence tea β β if before and min-release-age are both set in the same source, before wins (an explicit absolute date overrides a relative window). Across sources, the standard precedence applies (cli > env > project > user > global), so a higher-priority source can always relax or override a lower-priority one.
Same deal as min-release-age: when this cutoff blocks a fix that npm audit fix would install, npm keeps the vulnerable version, warns, and exits with a non-zero code. π¨ Not a silent failure. You will know.
Packages whose names match min-release-age-exclude are exempt from this filter. π
β³ min-release-age
- Default:
null - Type:
nullorNumber
If set, npm builds the tree so only versions that were available more than the given number of days ago will be installed. Same energy as before, except this one takes a relative number of days instead of an exact date. And again: if there are no versions available for the current set of deps, the command errors. π€
These two can absolutely coexist, btw β like min-release-age living in your .npmrc gets preserved when npm internally spawns a sub-process with --before while preparing a git: or github: dependency. When both apply: before wins within a single source, and across sources the standard precedence rules apply. Teamwork, but make it ranked. π
When this window stops npm audit fix from installing a patched version (because the fix was published too recently), npm keeps the package at its vulnerable version, warns that the fix was blocked, and exits with a non-zero code. To actually install the fix: add the package to min-release-age-exclude, or relax min-release-age or before. Your call, bestie.
Packages whose names match min-release-age-exclude are exempt from this filter. π
And nope β this value is not exported to the environment for child processes.
π min-release-age-exclude
- Default: (empty)
- Type:
String(can be set multiple times)
A list of package names or minimatch glob patterns that are exempt from the min-release-age (and before) filter. A matching package can always resolve to its newest version, even when a release-age window is set. VIP list behavior, fr fr.
Example: apply a release-age window to third-party deps but let your internally maintained packages update immediately β
min-release-age=7
min-release-age-exclude[]=@myorg/*
min-release-age-exclude[]=my-internal-pkg
Important bit: only the named package is exempt. Its own dependencies still follow the release-age policy unless they also match a pattern. And patterns match against the package name, so @myorg/* matches @myorg/shared-utils. π§
Another important bit: excluding a package does not change which registry it's fetched from. You should own your private scope on the public registry so that nobody else can publish a package with the same name. Go claim your name, bestie. π‘οΈ
Also, not exported to the environment for child processes. (You're sensing a pattern here, right?)
π bin-links
- Default:
true - Type:
Boolean
Tells npm to create symlinks (or .cmd shims on Windows) for package executables. That's the whole job. β¨
Set it to false and it just... won't. Super useful when you need to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. Yes, that's a real thing. No, we're not okay about it. π
πΈ fund
- Default:
true - Type:
Boolean
When true, displays the message at the end of each npm install acknowledging the number of dependencies looking for funding. That little "X packages are looking for funding" moment? That's this. See npm help fund for the details. Support your maintainers, they're doing unpaid labor. π«Ά
π΅ dry-run
- Default:
false - Type:
Boolean
Signals that you don't want npm to make any changes β it should only report what it would have done. A vibe check for your filesystem, basically.
You can pass this into any of the commands that modify your local installation, eg install, update, dedupe, uninstall, as well as pack and publish.
Note: this is NOT honored by other network related commands, egdist-tags,owner, etc. So don't assume it's a universal force field. π
π₯οΈ cpu
- Default:
null - Type:
nullorString
Override the CPU architecture of native modules to install. Acceptable values are the same as the cpu field of package.json, which comes from process.arch. Cross-compile girlies, this one's yours. β
π os
- Default:
null - Type:
nullorString
Override the OS of native modules to install. Acceptable values are the same as the os field of package.json, which comes from process.platform. Same energy as cpu, different dimension. π
π§ libc
- Default:
null - Type:
nullorString
Override the libc of native modules to install. Acceptable values are the same as the libc field of package.json. Tiny option, but she's carrying a whole platform-compat situation on her back. π
ποΈ workspace
- Default: (empty)
- Type:
String(can be set multiple times)
Enables running a command in the context of the configured workspaces of the current project, while filtering by running only the workspaces defined by this configuration option. Monorepo besties, this is your moment. π
Valid values for the workspace config are either:
- Workspace names
- Path to a workspace directory
- Path to a parent workspace directory (will result in selecting all workspaces within that folder)
When set for the npm init command, this may be set to the folder of a workspace which does not yet exist, so npm can create the folder and set it up as a brand new workspace within the project. Manifesting a workspace into existence. β¨
This value is not exported to the environment for child processes.
π° workspaces
- Default:
null - Type:
nullorBoolean
Set to true to run the command in the context of all configured workspaces. Everything, everywhere, all at once.
Explicitly setting this to false will cause commands like install to ignore workspaces altogether. Bye. π
When not set explicitly:
- Commands that operate on the
node_modulestree (install,update, etc.) will link workspaces into thenode_modulesfolder. - Commands that do other things (
test,exec,publish, etc.) will operate on the root project, unless one or more workspaces are specified in theworkspaceconfig.
This value is not exported to the environment for child processes.
πΈ include-workspace-root
- Default:
false - Type:
Boolean
Include the workspace root when workspaces are enabled for a command. Basically: do you want the parent invited to the party too?
When false, specifying individual workspaces via the workspace config β or all workspaces via the workspaces flag β will cause npm to operate only on the specified workspaces, and not on the root project. Root stays home. π
This value is not exported to the environment for child processes.
π¦ install-links
- Default:
false - Type:
Boolean
When set, file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. Real install, not a shortcut. Ngl, sometimes that's exactly what you need.
This option has no effect on workspaces. Workspaces stay symlinked, doing their own thing. π
β¨ See Also β¨
npm help installnpm help install-ci-testnpm help test
And that's the whole page, bestie β you officially read an entire manpage, I'm so proud of you. π₯Ή This one ships with npm 12.2.1, dated October 2026, filed under NPM-INSTALL-TEST(1). Go forth and install responsibly. π«Άπ
π¦ where this page comes from
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms