yarn icon indicating copy to clipboard operation
yarn copied to clipboard

`yarn add` with package already installed removes the package

Open remorses opened this issue 5 years ago • 1 comments

when using workspaces

Bug description

yarn add with package already installed removes the package It happens when using the latest tag Command

yarn add recharts@latest
yarn add recharts@latest

then i won't find recharts in node_modules

Steps to Reproduce

  1. create some workspaces packages (not sure if happens without workspaces)
  2. install 2 times a package
  3. try import the package or check the root node_modules

Environment

  • Node Version: 12.13
  • Yarn v1 Version: 1.22.4
  • OS and version: Mac Catalina

remorses avatar Apr 15 '20 14:04 remorses

I believe it also happens without the @latest tag. Also, I've noticed it happens for dependencies with ^ or ~ standing before the version number in package.json. For packages with a fixed version number, the problem does not occur.

lsliwaradioluz avatar Feb 21 '24 11:02 lsliwaradioluz