FrontEnd web
Published in

FrontEnd web

How to install pnpm in Linux?
How to install pnpm in Linux?

How to install the pnpm node package manager in Linux?

You can install PNPM with the debian distro. PNPM is faster and more disk space efficient.

You can install pnpm with one single command in Linux. To install pnpm, you need a one-off curl or wget command.

Suppose you have the curl command already installed in the distro. Otherwise, firstly install the curl command or use any other command.

// Please install one of them according to the requirement.sudo apt-get install curl     orsudo apt-get install wget

In this article, I show you how to install the pnpm package with curl and wget commands. In both commands, you do not need to add any other configuration to .bashrc file. Most of the time curl and wget automatically config the pnpm configuration in .bashrc file on installation time.

To install pnpm, run one of the following commands.

Steps

  1. Install with curl command
  2. Install with wget command

Install with curl command

You can install the pnpm latest version with the curl command. Simple copy-paste the following command in your terminal to install pnpm.

curl -fsSL https://get.pnpm.io/install.sh | sh -
Install pnpm with curl command
Install pnpm with curl command

After installation is complete. You check the cross configuration with .bashrc or .bash_profilefile. Your configuration looks different, and your configuration is shown in the terminal.

# Next configuration changes were made:export PNPM_HOME="/home/rajdeepsingh/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"

Following configuration, exit already. Then skip this section. You do not need to add code in .bashrc .

Install with wget command

You can install the pnpm latest version with the wget command. Simple copy-paste the following command in your terminal to install pnpm.

wget -qO- https://get.pnpm.io/install.sh | sh -
Install pnpm with wget command
Install pnpm with wget command

After installation is complete. You can check the cross configuration with .bashrc or .bash_profilefile. Your configuration looks different, and your configuration is shown in your terminal.

# Next configuration changes were made:export PNPM_HOME="/home/rajdeepsingh/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"

Following configuration, exit already. Then skip this section and You do not need to add the pnpm configuration code in .bashrc or .bash_profile file.

Verify pnpm configuration

check pnpm — version
check pnpm — version

Errors

After running the pnpm version command, you face any errors.

  1. Firstly close and reopen your terminal.
  2. If the error is not resolved with the first step, then restart your laptop or pc.
  3. Your error not be solved with one and second steps, which means your pnpm configuration is not added successfully in the .bashrc file.

Conclusion

PNPM is a great nodejs package manager for nodejs. PNPM provide similar functionality to yarn and npm.

PNPM is faster and more disk space efficient than other node package managers. Therefore, I recommended using the PNPM instead npm and yarn.

You can share and follow on Twitter and Linkedin. If you like my work, please read more content on the officialrajdeepsingh. dev, frontend web, and sign up for a free newsletter on the frontend web.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rajdeep singh

Rajdeep singh

525 Followers

JavaScript || Reactjs || Nextjs || Python || Rust || Biotechnology || Bioinformatic || Front-end Developer || Writer || https://officialrajdeepsingh.dev/