Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn - remove package best practices

Tags:

yarnpkg

If you want to remove a package using Yarn should you:

  1. run yarn remove [package]

or

  1. delete it from package.json and run yarn install

Do both work the same? Will #2 update yarn.lock?

like image 375
mattnedrich Avatar asked Mar 06 '17 02:03

mattnedrich


People also ask

How do you remove yarn packages?

If you run yarn remove [package] it will remove the package from node_modules and also from the yarn. lock file. If you manually delete from package. json and then run yarn install , the deleted package is not installed and the yarn.

How do you clean yarn dependencies?

Do yarn remove on each of the dependency packages in package. json ( dependencies and devDependencies entries). This should remove all dependencies including all intermediate dependencies from yarn. lock .


1 Answers

If you run yarn remove [package] it will remove the package from node_modules and also from the yarn.lock file.

If you manually delete from package.json and then run yarn install, the deleted package is not installed and the yarn.lock file is not updated.

like image 105
Kasiriveni Avatar answered Oct 22 '22 23:10

Kasiriveni