versioned_docs_archived/version-4.x/pnpm-install.md
pnpm install is used to install all dependencies for a project.
| Command | Meaning |
|---|---|
pnpm i --offline | no network requests |
pnpm i --frozen-lockfile | pnpm-lock.yaml is not updated |
pnpm i --prefer-frozen-lockfile | when possible, pnpm-lock.yaml is not updated |
The location where all the packages are saved on the disk.
The store should be always on the same disk on which installation is happening. So there will be one store per disk.
If there is a home directory on the current disk, then the store is created in <home dir>/.pnpm-store. If there is no
homedir on the disk, then the store is created in the root. For example, if installation is happening on disk D
then the store will be created in D:\.pnpm-store.
It is possible to set a store from a different disk but in that case pnpm will copy, not link, packages from the store. Hard links are possible only inside a filesystem.
If true, pnpm will use only packages already available in the store. If a package won't be found locally, the installation will fail.
Added in: v1.28.0
If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server.
To force full offline mode, use --offline.
Controls the maximum number of HTTP requests that can be done simultaneously.
Controls the number of child processes run parallelly to build node modules.
Dangerous! If false, the store is not locked. It means that several installations using the same store can run simultaneously.
Can be passed in via a CLI option. --no-lock to set it to false. E.g.: pnpm install --no-lock.
If you experience issues similar to the ones described in #594, use this option to disable locking. In the meanwhile, we'll try to find a solution that will make locking work for everyone.
Do not execute any scripts defined in the project package.json and its dependencies.
Added in: v1.25.0
pnpmfile.js will be ignored. Useful together with --ignore-scripts when you want to make sure that
no script gets executed during install.
Added in: v1.39.0
The location of the local pnpmfile.
pnpm will not install any package listed in devDependencies if the NODE_ENV environment variable is set to production. Use this flag to instruct pnpm to ignore NODE_ENV and take its production-or-not status from this flag instead.
Notes:
--productionis the same as--production=true.--prodis an alias of--production.
Added in: v1.39.0
The location of a global pnpmfile. A global pnpmfile is used by all projects during installation.
NOTE: It is recommended to use local pnpmfiles. Only use a global pnpmfile, if you use pnpm on projects that don't use pnpm as the primary package manager.
If true, symlinks leaf dependencies directly from the global store. Leaf dependencies are
packages that have no dependencies of their own. Setting this config to true might break some packages
that rely on location but gives an average of 8% installation speed improvement.
Added in: v1.8.0
If false, doesn't check whether packages in the store were mutated.
Added in: v1.25.0
Controls the way packages are imported from the store.
Added in: v1.32.0 (initially named shrinkwrap)
When set to false, pnpm won't read or generate a pnpm-lock.yaml file.
Added in: v1.26.0 (initially named shrinkwrap-only)
When used, only updates pnpm-lock.yaml and package.json instead of checking node_modules and downloading dependencies.
Added in: v1.37.1 (initially named frozen-shrinkwrap)
If true, pnpm doesn't generate a lockfile and fails if an update is needed.
Added in: v1.37.1 (initially named prefer-frozen-shrinkwrap)
When true and the available pnpm-lock.yaml satisfies the package.json
then a headless installation is performed. A headless installation is faster than a regular one
because it skips dependencies resolution and peers resolution.
Allows to choose the reporter that will print info about the installation progress.
Added in: v1.30.0
Starts a store server in the background. The store server will keep running after installation is done.
To stop the store server, run pnpm server stop
Added in: v2.5.0
Only allows installation with a store server. If no store server is running, installation will fail.
Added in: v1.31.0
Stability: Experimental
Use and cache the results of (pre/post)install hooks.
Added in: v1.31.0
Stability: Experimental
Only use the side effects cache if present, do not create it for new packages.
Added in: v1.34.0
If true, pnpm creates a flat node_modules that look almost like a node_modules created by npm or Yarn.
Please only use this option when there is no other way to make a project work with pnpm.
The strict node_modules created by pnpm should always work, if it does not, most likely a dependency is
missing from package.json. Use this config only as a temporary fix.
Added in: v2.15.0
If true, commands fail on missing or invalid peer dependencies.
Added in: v3.1.0
Sets the resolutions strategy used during installation.
Added in: v3.6.0
When true, beta features of the CLI are used. This means that you may get some changes to the CLI functionality
that are breaking changes.