的Broccoli MergeError.DS_在angular cli中存储文件



我在尝试构建基于angular cli的应用程序时遇到了这个问题。

Build failed.
The Broccoli Plugin: [BroccoliMergeTrees] failed with:
Error: Merge error: file .DS_Store exists in /private/var/www/myapp/src/app/tmp/broccoli_merge_trees-input_base_path-W89nbkgj.tmp/0 and /private/var/www/myapp/src/app/tmp/broccoli_merge_trees-input_base_path-W89nbkgj.tmp/1
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
    at BroccoliMergeTrees._mergeRelativePath (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/broccoli-merge-trees/index.js:266:17)
    at BroccoliMergeTrees.build (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/broccoli-merge-trees/index.js:70:24)
    at /private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/broccoli-plugin/read_compat.js:61:34
    at lib$rsvp$$internal$$tryCatch (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
The broccoli plugin was instantiated at: 
    at BroccoliMergeTrees.Plugin (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/broccoli-plugin/index.js:10:31)
    at new BroccoliMergeTrees (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/broccoli-merge-trees/index.js:30:10)
    at Angular2App._buildTree (/private/var/www/myapp/src/app/node_modules/angular-cli/lib/broccoli/angular2-app.js:170:14)
    at new Angular2App (/private/var/www/myapp/src/app/node_modules/angular-cli/lib/broccoli/angular2-app.js:53:23)
    at module.exports (/private/var/www/myapp/src/app/angular-cli-build.js:10:10)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/build.js:15:19)
    at /private/var/www/myapp/src/app/node_modules/angular-cli/addon/ng2/commands/test.js:63:30
    at lib$rsvp$$internal$$tryCatch (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
    at /private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:331:11
    at lib$rsvp$asap$$flush (/private/var/www/myapp/src/app/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)

一切都很完美,直到我休息了5-6个小时的开发,然后出现了这个错误。如何将{overwrite: true}选项传递给Broccoli?

我遇到了同样的问题,删除临时文件夹时运气不佳

我所做的就是移除。DS递归存储
1.打开终端并进入您的项目文件夹
2.最后,在命令行中,键入:
find . -name '*.DS_Store' -type f -delete

https://jonbellah.com/recursively-remove-ds-store/

它对我有效

我发现angular-cli有问题,并在此处发布。

最后,我发现在合并节点时,有一个地方缺少{overwrite: true}选项。

angular cli/lib/cilora/angular 2 app.js中的第170行

merged = new BroccoliMergeTrees([merged, publicFolder]);

更改为

merged = new BroccoliMergeTrees([merged, publicFolder], {overwrite: true});

现在一切都很好。

我已经为此创建了一个PR,但不幸的是,Broccoli将在下一个angular cli版本中被删除。

相关内容

  • 没有找到相关文章