Yarn: Yarn removing folder within installed dependency

Created on 1 Feb 2017  路  2Comments  路  Source: yarnpkg/yarn

Bug

I am using Yarn v0.19.1 to install some dependencies. I deleted my node_modules folder completely and did a fresh yarn install.

I am trying to install the dependency leaflet using yarn add leaflet (also tried just yarn when leaflet is present in my package.json. The module installs successfully, except during the Cleaning Modules... phase, Yarn removes the images folder which would typically live within leaflet/dist/images. When I do a npm install leaflet this folder does not get removed.

During a yarn install, the images folder is present until the Cleaning modules phase happens.

I checked the package.json in the leaflet library and nothing seemed out of the ordinary there. It runs a jake file, but even within that file nothing is being deleted related to images.

_I don't believe this is a leaflet issue, but if it is I can direct this issue their way._

Here is what the folder looks like, within my node_modules folder, for both package manager installs:

Yarn
image

NPM
image

Reproduction steps

Not working

  1. yarn add leaflet
  2. View the node_modules/leaflet/dist folder
  3. Notice no images folder

Working

  1. npm install leaflet
  2. View the node_modules/leaflet/dist folder
  3. Notice a folder named images with image files (.png) inside

Expected behavior

The images folder should be present within the leaflet/dist folder

Versions

Node v.7.4.0
Yarn v0.19.1
OS X 10.11.6

Most helpful comment

hitting this a couple of times already... removing .yarnclean works but it does seem like yarn clean is removing files a bit too aggressively - the resource files (.png, .svg, etc) are actually referenced by other files and shouldn't be removed

All 2 comments

There was a .yarnclean file in my project. This added some files/folders to ignore when installing dependencies. Running yarn clean added this file and I wasn't aware until I saw this issue. Viewing the docs also gave the same info.

I resolved this by removing images from the set of ignored directories.

hitting this a couple of times already... removing .yarnclean works but it does seem like yarn clean is removing files a bit too aggressively - the resource files (.png, .svg, etc) are actually referenced by other files and shouldn't be removed

Was this page helpful?
0 / 5 - 0 ratings