Yarn删除已安装依赖项中的文件夹

时间:2017-01-31 20:30:46

标签: npm leaflet yarnpkg

我正在使用Yarn v0.19.1来安装一些依赖项。我完全删除了node_modules文件夹并进行了新的yarn安装。

我正在尝试使用yarn add leaflet安装依赖项leaflet。该模块安装成功,除了在Cleaning Modules...阶段,Yarn删除images文件夹,该文件夹通常位于leaflet/dist/images内。当我执行npm install leaflet时,此文件夹不会被删除。

在纱线安装期间,images文件夹一直存在,直到Cleaning modules阶段发生。

谁/这是做什么的?这是yarn的事吗?或者这是leaflet库中指定的内容吗?我怎么能解决这个问题?

我检查了传单库中的package.json,没有任何看似异常的东西。它运行一个jake文件,但即使在该文件中也没有任何与图像相关的内容被删除。

对于两个软件包管理器安装,以下是我的node_modules文件夹中文件夹的外观:

yarn install

NPM npm install

1 个答案:

答案 0 :(得分:2)

我的项目中有一个.yarnclean文件。这会在安装依赖项时添加一些要忽略的文件/文件夹。正在运行yarn clean添加了此文件,在看到this issue之前我一直都不知道。 Viewing the docs也提供了相同的信息。

我通过从被忽略的目录集中删除images来解决这个问题。

以下是我的.yarnclean文件示例:

# test directories
__tests__
test
tests
powered-test

# asset directories
docs
doc
website
assets

# examples
example
examples

# code coverage directories
coverage
.nyc_output

# build scripts
Makefile
Gulpfile.js
Gruntfile.js

# configs
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json

# misc
*.gz
*.md
相关问题