yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Install result is different after `remove clean add` #3056

Open Stupidism opened 7 years ago

Stupidism commented 7 years ago

Do you want to request a feature or report a bug? Original issue is here: https://github.com/istanbuljs/istanbuljs/issues/28

If the current behavior is a bug, please provide the steps to reproduce.

Steps to reproduce

git clone git@github.com:Stupidism/react-starter-kit.git -b feat/test-coverage
cd react-starter-kit
yarn install 

# First time, it should be working
yarn run coverage 

yarn remove nyc
yarn clean
yarn add --dev nyc

# This time, it breaks
yarn run coverage 

What is the expected behavior? there should be an assests folder under node_modules/istanbul-reports/lib/html. After remove clean add, it's gone.

Please mention your node.js, yarn and operating system version.

node -v v6.10.0
yarn run v0.22.0
linux kubuntu15
JaKXz commented 7 years ago

I can confirm this issue as well and I'm pretty sure I've seen it on older versions of yarn as well. A quicker way to reproduce:

npm i -D istanbul-reports
# vs.
yarn add --dev istanbul-reports

npm pulls down all the files in the lib folder which is specified in istanbul-reports' files array, but yarn misses the lib/html/assets folder (among others).

Stupidism commented 7 years ago

@yarnpkgbot Anybody here?

JaKXz commented 7 years ago

I think this has been resolved with v0.23.2 @Stupidism, could you try it out again?

Stupidism commented 7 years ago

Not fixed yet! @JaKXz

nyon commented 7 years ago

I had a similar problem when using ember-cli and yarn together. After calling yarn clean instead of yarn cache clean a file named .yarnclean is created. This file contains, among other entries, a directive to remove folders called assets. This led to a number of weird errors. So I don't think it is a bug here but rather a misunderstanding of yarn itself. To circumvent this I would propose to create the .yarnclean interactively, so the developer notices the error earlier.

see also #2438