Ana içeriğe atla
Sürüm: 7.x

pnpm install

Ayrıca: i

pnpm install ile projede tanımlı olan tüm kütüphaneleri yükleyebilirsin.

Fakat yükleme komutu, güncel olmayan bir lock dosyasıyla CI ortamında çalıştırıldığı zaman, hata verir.

pnpm install komutu, workspace (çalışma ortamı) içerisinde çalıştırıldığı zaman ise, workspace içerisindeki tüm projelere tanımlı olan tüm kütüphaneleri yükler. Her hangi bir sebepten dolayı bu özelliği devre dışı bırakmak istersen, recursive-install ayarını false olarak ayarlayabilirsin.

Kısaca;

Komutİşlevi
pnpm i --offlineÇevrimdışı şekilde, ortak alandan yükleme yapar
pnpm i --frozen-lockfileSadece pnpm-lock.yaml odaklı yükleme yapar
pnpm i --lockfile-onlypnpm-lock.yaml dosyasını günceller

Parametreler

--force

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).

--offline

  • Varsayılan: false
  • Tip: 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.

--prefer-offline

  • Varsayılan: false
  • Tip: Boolean

Eğer true ise, önbelleğe alınmış veriler için eskime denetimleri atlanır, ancak eksik data sunucudan istenir. Eğer tam anlamıyla çevrimdışı çalışması gerekirse, --offline parametresini kullanabilirsin.

--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.

--no-optional

optionalDependencies kısmındaki kütüphaneleri göz ardı ederek yükleme yapar.

--lockfile-only

  • Varsayılan: false
  • Tip: Boolean

Kullanıldığında, yalnızca pnpm-lock.yaml ve package.json dosyalarını günceller. node_modules dizinine hiçbir şey yazılmaz.

--fix-lockfile

Bozuk lockfile girişlerini otomatik olarak düzelt.

--frozen-lockfile

  • Varsayılan:
    • Normalde: false
    • CI ortamında: true, tabi lock dosyası varsa eğer
  • Tip: Boolean

Kullanıldığında veya true olarak belirtildiğinde pnpm, sadece lock dosyasını baz alarak ve lock dosyasında hiç bir değişiklik yapmadan yükleme yapar. Eğer lock dosyası güncel değilse veya hiç oluşturulmamışsa, işlem hata verecektir.

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

https://github.com/watson/ci-info/blob/44e98cebcdf4403f162195fbcf90b1f69fc6e047/index.js#L54-L61
exports.isCI = !!(
env.CI || // Travis CI, CircleCI, Cirrus CI, GitLab CI, Appveyor, CodeShip, dsari
env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
env.BUILD_NUMBER || // Jenkins, TeamCity
env.RUN_ID || // TaskCluster, dsari
exports.name ||
false
)

--merge-git-branch-lockfiles

Added in: v7.3.0

Merge all git branch lockfiles. Read more about git branch lockfiles.

--reporter=<name>

  • Varsayılan:
    • TTY akışlı ortamda: default
    • TTY akışı olmayan ortamda: append-only
  • Tip: 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 - varsayılan mod. TTY akışa sahip ortamda kullanılır
  • append-only - the output is always appended to the end. İmleç hareketleri vs. kullanılamaz
  • ndjson - detaylı veri çıkışı için kullanılır. Çıktıların tamamını, ndjson biçiminde gösterir

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

--use-store-server

  • Varsayılan: false
  • Tip: 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

--shamefully-hoist

  • Varsayılan: false
  • Tip: Boolean

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

--ignore-scripts

  • Varsayılan: false
  • Tip: Boolean

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

--filter <package_selector>

Buradan daha fazla bilgiye ulaşabilirsin.