Movatterモバイル変換


[0]ホーム

URL:


Passer au contenu principal
Ceci est une documentation non publiée pour la versionSuivant de pnpm.
Pour une documentation à jour, consultez ladernière version (10.x).
Version : Suivant

pnpm CLI

Différences avec npm

Contraitement à npm, pnpm valide toutes les options. Par exemple,pnpm install --target_arch x64 échouera car--target_arch n'est pas une option valide depnpm install.

Cependant, certaines dépendances peuvent utiliser la variable d'environnementnpm_config_, qui est remplie à partir des options CLI. Dans ce cas, vous disposez des options suivantes:

  1. définissez explicitement la variable :npm_config_target_arch=x64 pnpm install
  2. forcez l'option inconnue avec--config.:pnpm install --config.target_arch=x64

Options

-C <path>, --dir <path>

S'exécute comme si pnpm avait été lancé dans<path> au lieu du répertoire de travail actuel.

-w, --workspace-root

Run as if pnpm was started in the root of theworkspace instead of the current working directory.

Commandes

Pour plus d'informations, référez-vous à la documentation pour avoir la liste des commandes CLI. Voici une liste de commandes utiles, avec leur équivalence en npm, pour vous aider à démarrer :

commande npméquivalent pnpm
npm installpnpm install
npm i <pkg>[pnpm add <pkg>]
npm run <cmd>[pnpm <cmd>]

Lorsqu'une commande inconnue est utilisée, pnpm va rechercher un script avec le nom donné,pnpm run lint est donc identique àpnpm lint. If there is no script with the specified name, then pnpm will execute the command as a shell script, so you can do things likepnpm eslint (seepnpm exec).

Environment variables

Some environment variables that are not pnpm related might change the behaviour of pnpm:

These environment variables may influence what directories pnpm will use for storing global information:

  • XDG_CACHE_HOME
  • XDG_CONFIG_HOME
  • XDG_DATA_HOME
  • XDG_STATE_HOME

You can search the docs to find the settings that leverage these environment variables.


[8]ページ先頭

©2009-2025 Movatter.jp