Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
186
rated 0 times [  188] [ 2]  / answers: 1 / hits: 5894  / 2 Years ago, tue, august 16, 2022, 12:00:00

I am work on monorepo stuff, and found that some guys use pnpm install to install packages in workspace, but some other use pnpm add.


in the pnpm docs, its seem like the same between add and install command, but there are some different options like --offline (for install)、--workspace(for add), and if I use pnpm install [pkg name] --workspace, its work normally.


so what the different between pnpm install and pnpm add?


More From » monorepo

 Answers
35

There is not much difference between them. In most cases they are interchangeable:


pnpm install <args?>: without args it will scan and install all the modules listed in pnpm-lock.yaml, in case of args it works as pnpm add


pnpm add <args>: It will install one more package.


if choose yes i will use pnpm add because it is new modern syntax that supports all package managers (npm add, yarn add)


[#36] Friday, July 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
abagail

Total Points: 528
Total Questions: 109
Total Answers: 101

Location: Western Sahara
Member since Mon, May 3, 2021
3 Years ago
abagail questions
Mon, Sep 27, 21, 00:00, 3 Years ago
Sun, May 30, 21, 00:00, 3 Years ago
Sun, Jan 3, 21, 00:00, 3 Years ago
Mon, Oct 26, 20, 00:00, 4 Years ago
;