pnpm vs npm | pnpm (2024)

npm's flat tree

npm maintains a flattened dependency tree as of version 3. This leads to lessdisk space bloat, with a messy node_modules directory as a side effect.

On the other hand, pnpm manages node_modules by using hard linking andsymbolic linking to a global on-disk content-addressable store. This lets you get the benefits of far less disk space usage, while also keeping yournode_modules clean. There is documentation on the store layout if you wishto learn more.

The good thing about pnpm's proper node_modules structure is that it"helps to avoid silly bugs" by making it impossible to use modules that are notspecified in the project's package.json.

Installation

pnpm does not allow installation of packages without saving them topackage.json. If no parameters are passed to pnpm add, packages are saved asregular dependencies. Like with npm, --save-dev and --save-optional can beused to install packages as dev or optional dependencies.

As a consequence of this limitation, projects won't have any extraneous packageswhen they use pnpm unless they remove a dependency and leave it orphaned. That'swhy pnpm's implementation of the prune command does not allow you to specifypackages to prune - it ALWAYS removes all extraneous and orphaned packages.

Directory dependencies

Directory dependencies start with the file: prefix and point to a directory inthe filesystem. Like npm, pnpm symlinks those dependencies. Unlike npm, pnpmdoes not perform installation for the file dependencies.

This means that if you have a package called foo (<root>/foo) that hasbar@file:../bar as a dependency, pnpm won't perform installation for<root>/bar when you run pnpm install on foo.

If you need to run installations in several packages at the same time, forinstance in the case of a monorepo, you should look at the documentation forpnpm -r.

pnpm vs npm | pnpm (2024)
Top Articles
Investment Banking vs. Law: What's the Difference?
California went big on rooftop solar. Now that's a problem for landfills
My Arkansas Copa
Hotels Near 625 Smith Avenue Nashville Tn 37203
Unit 30 Quiz: Idioms And Pronunciation
Avonlea Havanese
Blanchard St Denis Funeral Home Obituaries
Tj Nails Victoria Tx
How To Get Free Credits On Smartjailmail
Words From Cactusi
Barstool Sports Gif
Overzicht reviews voor 2Cheap.nl
Acbl Homeport
Azeroth Pilot Reloaded - Addons - World of Warcraft
Bros Movie Wiki
Voyeuragency
Uhcs Patient Wallet
Funny Marco Birth Chart
iLuv Aud Click: Tragbarer Wi-Fi-Lautsprecher für Amazons Alexa - Portable Echo Alternative
Mzinchaleft
NHS England » Winter and H2 priorities
Unity - Manual: Scene view navigation
Swgoh Blind Characters
Raz-Plus Literacy Essentials for PreK-6
Governor Brown Signs Legislation Supporting California Legislative Women's Caucus Priorities
Hampton University Ministers Conference Registration
How to Make Ghee - How We Flourish
Idle Skilling Ascension
Kirk Franklin Mother Debra Jones Age
Kroger Feed Login
4Oxfun
Craftsman Yt3000 Oil Capacity
Nail Salon Open On Monday Near Me
Bt33Nhn
4083519708
CVS Near Me | Somersworth, NH
Laff Tv Passport
Mckinley rugzak - Mode accessoires kopen? Ruime keuze
At Home Hourly Pay
13 Fun &amp; Best Things to Do in Hurricane, Utah
Pain Out Maxx Kratom
Thotsbook Com
Here's Everything You Need to Know About Baby Ariel
Lady Nagant Funko Pop
Reilly Auto Parts Store Hours
Crigslist Tucson
Food and Water Safety During Power Outages and Floods
Diccionario De Los Sueños Misabueso
Sam's Club Fountain Valley Gas Prices
Tenichtop
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated:

Views: 6755

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.