Stop using npm or yarn to install node_modules
Tags: javascript, webdev, programming, kristiyanvelkov
Published: 2023-07-18 04:29:00

**PNPM saves disk space, boosts installation speed, and creates a non-flat node_modules directory.**

## What is pnpm ?
**Pnpm** is a package manager for JavaScript and Node.js applications. It stands for "Fast, disk space efficient package manager" and is designed to address some of the limitations and issues associated with other popular package managers like **npm** and **Yarn**.

---

## Why pnpm ?

pnpm has three big goals:
- saving disk space 
- boosting installation speed
- creating a non-flat node_modules directory.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzfggf2km0ox33sr18c4.png)



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7ni9ws8u2gcbfcvokr7.png)

---

## Here are several reasons why you might consider using pnpm over Yarn and npm:

1. **Disk Space Efficiency**: pnpm's approach of using a shared store and hard linking significantly reduces disk space requirements compared to Yarn and npm. This can be particularly advantageous when working on multiple projects or maintaining a large codebase, as it saves valuable disk space.

2. **Faster Installations and Updates**: pnpm is designed to optimize installation and update processes. By leveraging parallel execution of scripts and efficient dependency resolution, pnpm can provide faster installation and update times compared to Yarn and npm, especially for projects with numerous dependencies.

3. **Network Bandwidth Optimization**: With pnpm, you can set up a store server to share packages across projects and machines. This helps reduce network bandwidth usage by avoiding redundant downloads. It can be particularly beneficial in team settings or when working on distributed systems.

4. **Improved Development Workflow**: pnpm offers features that can enhance your development workflow. For example, it supports parallel execution of scripts, which can speed up tasks like building, testing, and linting. Additionally, pnpm integrates well with other development tools and has an active community contributing to its improvement.

5. **Compatibility and Ecosystem Support**: pnpm is compatible with the npm registry and uses the same package.json format, making it seamless to work with existing npm-based projects. It also integrates with popular build tools, testing frameworks, and development workflows. While npm and Yarn have larger ecosystems, pnpm has been gaining popularity and community support.


---
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2zcidciydse9dofz4fs.png)


[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kristiyan-velkov-763130b3/)

<a href="https://revolut.me/kristiyanvelkov" target="_blank">
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxmsw2d2ooukhdg8x5ar.png)
</a>

If you like my work and want to support me to work hard, please donate via:

<a href="https://revolut.me/kristiyanvelkov" title="Link to Revolut">Revolut website payment</a> or use the QR code above.                                                                                                                           


**Thanks a bunch for supporting me! It means a LOT 😍**