Pular para o conteúdo principal
Versão: 8.x

pnpm install

Aliases: i

pnpm install é usado para instalar todas as dependências de um projeto.

Num ambiente de CI, a instalação falhará se um lockfile estiver presente, mas precise ser atualizado.

Dentro de uma área de trabalho, pnpm install instala todas as dependências em todos os projetos. Se quiser desativar este comportamento, mude a configuração de recursive-install para false.


pnpm i --offlineInstala offline apenas com os pacotes em cache
pnpm i --frozen-lockfileO pnpm-lock.yaml não é atualizado
pnpm i --lockfile-onlyApenas o pnpm-lock.yaml é atualizado



Force reinstall dependencies: refetch packages modified in store, recreate a lockfile and/or modules directory created by a non-compatible version of pnpm. Install all optionalDependencies even they don't satisfy the current environment(cpu, os, arch).


  • Padrão: low
  • Tipo: Boolean

If true, pnpm will use only packages already available in the store. If a package won't be found locally, the installation will fail.


  • Padrão: low
  • Tipo: Boolean

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.

--prod, -P

pnpm will not install any package listed in devDependencies and will remove those insofar they were already installed, if the NODE_ENV environment variable is set to production. Use this flag to instruct pnpm to ignore NODE_ENV and take its production status from this flag instead.

--dev, -D

Only devDependencies are installed and dependencies are removed insofar they were already installed, regardless of the NODE_ENV.


optionalDependencies are not installed.


  • Padrão: low
  • Tipo: Boolean

When used, only updates pnpm-lock.yaml and package.json. Nothing gets written to the node_modules directory.


Fix broken lockfile entries automatically.


  • Padrão:
    • Fora de CI: false
    • Em CI: true, se um lockfile estiver presente
  • Tipo: Boolean

If true, pnpm doesn't generate a lockfile and fails to install if the lockfile is out of sync with the manifest / an update is needed or no lockfile is present.

This setting is true by default in CI environments. The following code is used to detect CI environments:

exports.isCI = !!(
env.CI || // Travis CI, CircleCI, Cirrus CI, GitLab CI, Appveyor, CodeShip, dsari
env.BUILD_NUMBER || // Jenkins, TeamCity
env.RUN_ID || // TaskCluster, dsari
exports.name ||


  • Padrão:
    • Em stdout TTY: default
    • Em stdout não TTY: append-only
  • Tipo: default, append-only, ndjson, silent

Allows you to choose the reporter that will log debug info to the terminal about the installation progress.

  • silent - no output is logged to the console, not even fatal errors
  • default - o relator padrão quando o stdout é TTY
  • append-only - the output is always appended to the end. O cursor não é manipulado
  • ndjson - o relator mais detalhador. Todos os logs sairão no formato ndjson

If you want to change what type of information is printed, use the loglevel setting.


  • Padrão: low
  • Tipo: Boolean

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


  • Padrão: low
  • Tipo: Boolean

Creates a flat node_modules structure, similar to that of npm or yarn. WARNING: This is highly discouraged.


  • Padrão: low
  • Tipo: Boolean

Do not execute any scripts defined in the project package.json and its dependencies.

--filter <package_selector>

Leia mais sobre filtragem.


Adicionado em: v8.3.0

Re-runs resolution: useful for printing out peer dependency issues.