Yarn - remove package best practices

mattnedrich picture mattnedrich · Mar 6, 2017 · Viewed 44.5k times · Source

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?

Answer

Kasiriveni picture Kasiriveni · Mar 21, 2017

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

if you go manually deleted form package.json and run yarn install none of the package is install . yarn.lock files did not updated