【问题标题】:Yarn removes folder within installed dependencyYarn 删除已安装依赖项中的文件夹
【发布时间】:2017-01-31 20:30:46
【问题描述】:

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

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

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

谁/什么在做这件事?这是yarn 做的吗?或者这是leaflet 库中指定的内容?我该如何解决这个问题?

我检查了传单库中的package.json,那里似乎没有什么不寻常的地方。它运行一个 jake 文件,但即使在该文件中,也不会删除与图像相关的任何内容。

这是我的node_modules 文件夹中的文件夹的样子,用于安装包管理器:

纱线

npm

【问题讨论】:

    标签: npm leaflet yarnpkg


    【解决方案1】:

    我的项目中有一个.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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-07
      • 2019-01-24
      • 2020-10-03
      • 2021-06-23
      • 2021-11-18
      • 1970-01-01
      • 2015-04-01
      • 2012-11-10
      相关资源
      最近更新 更多