Langsung ke konten utama
Versi: 7.x

pnpm store

Mengelola penyimpanan paket.

Perintah

status

Checks for modified packages in the store.

Returns exit code 0 if the content of the package is the same as it was at the time of unpacking.

add

Secara fungsional setara dengan pnpm add, kecuali ini menambahkan paket baru ke penyimpanan secara langsung tanpa mengubah proyek atau file apa pun di luar penyimpanan.

prune

Menghapus paket yang tidak direferensikan dari penyimpanan.

Unreferenced packages are packages that are not used by any projects on the system. Packages can become unreferenced after most installation operations, for instance when dependencies are made redundant.

For example, during pnpm install, package foo@1.0.0 is updated to foo@1.0.1. pnpm will keep foo@1.0.0 in the store, as it does not automatically remove packages. If package foo@1.0.0 is not used by any other project on the system, it becomes unreferenced. Running pnpm store prune would remove foo@1.0.0 from the store.

Running pnpm store prune is not harmful and has no side effects on your projects. If future installations require removed packages, pnpm will download them again.

It is best practice to run pnpm store prune occasionally to clean up the store, but not too frequently. Sometimes, unreferenced packages become required again. This could occur when switching branches and installing older dependencies, in which case pnpm would need to re-download all removed packages, briefly slowing down the installation process.

Harap dicatat bahwa perintah ini dilarang ketika server penyimpanan sedang berjalan.

path

Mengembalikan jalur ke direktori penyimpanan aktif.