Ember.js 2.7不使用yarn构建,而是使用npm构建



版本:

  • ember.js 2.7,ember数据2.7
  • ember cli 2.9.1//同样适用于ember cli 2.7
  • 节点6.9.1,npm 3.10.9//对于节点4.4.4和npm 2.15.5为true
  • Mac El Capitan

复制步骤:

  • rm -Rf node_modules bower_components
  • yarn
  • bower install
  • ember sember build

症状:


Build failed.
The Broccoli Plugin: 
[Funnel: Funnel
  vendor/ember-cli-qunit/images
  /assets
 include:2] failed with:
Error: ENOENT: no such file or directory, scandir '/Users/somePath/client/tmp/funnel-input_base_path-nIg5n9K9.tmp/0/vendor/ember-cli-qunit/images/'
    at Error (native)
    at Object.fs.readdirSync (fs.js:951:18)
    at FSMonitor._measure (/Users/somePath/client/node_modules/heimdalljs-fs-monitor/index.js:66:21)
    at Object.readdirSync (/Users/somePath/client/node_modules/heimdalljs-fs-monitor/index.js:82:30)
    at _walkSync (/Users/somePath/client/node_modules/broccoli-funnel/node_modules/walk-sync/index.js:64:18)
    at Function.entries (/Users/somePath/client/node_modules/broccoli-funnel/node_modules/walk-sync/index.js:40:10)
    at Funnel.processFilters (/Users/somePath/client/node_modules/broccoli-funnel/index.js:264:26)
    at Funnel.build (/Users/somePath/client/node_modules/broccoli-funnel/index.js:202:10)
    at /Users/somePath/client/node_modules/broccoli-plugin/read_compat.js:61:34
    at tryCatch (/Users/somePath/client/node_modules/rsvp/dist/rsvp.js:538:12)
The broccoli plugin was instantiated at:
    at Funnel.Plugin (/Users/somePath/client/node_modules/broccoli-plugin/index.js:7:31)
    at new Funnel (/Users/somePath/client/node_modules/broccoli-funnel/index.js:56:10)
    at /Users/somePath/client/node_modules/ember-cli/lib/broccoli/ember-app.js:1474:12
    at Array.map (native)
    at EmberApp.otherAssets (/Users/somePath/client/node_modules/ember-cli/lib/broccoli/ember-app.js:1468:61)
    at EmberApp.toArray (/Users/somePath/client/node_modules/ember-cli/lib/broccoli/ember-app.js:1642:10)
    at EmberApp.toTree (/Users/somePath/client/node_modules/ember-cli/lib/broccoli/ember-app.js:1662:30)
    at module.exports (/Users/somePath/client/ember-cli-build.js:67:16)
    at CoreObject.setupBroccoliBuilder (/Users/somePath/client/node_modules/ember-cli/lib/models/builder.js:70:19)
    at CoreObject.init (/Users/somePath/client/node_modules/ember-cli/lib/models/builder.js:50:10)

如果我在纱线后执行npm install,控制台输出为:


npm WARN prefer global jshint@2.9.4 should be installed with -g
npm WARN prefer global marked@0.3.6 should be installed with -g
npm WARN prefer global node-gyp@3.3.1 should be installed with -g
> node-sass@3.10.1 install /Users/somePath/client/node_modules/node-sass
> node scripts/install.js

> node-sass@3.10.1 postinstall /Users/somePath/client/node_modules/node-sass
> node scripts/build.js
"/Users/somePath/client/node_modules/node-sass/vendor/darwin-x64-46/binding.node" exists.
 testing binary.
Binary is fine; exiting.
npm WARN prefer global npm@3.10.9 should be installed with -g
> spawn-sync@1.0.15 postinstall /Users/somePathclient/node_modules/spawn-sync
> node postinstall
auth0-ember-simple-auth@1.1.0 node_modules/auth0-ember-simple-auth

如果我rm -Rf node_modules并执行标准的npm install,那么构建就不会像以前一样出现错误。

有什么想法吗?

UPDATE:npm installyarn构建的node_modules文件夹的差异:


仅在yarn_node_modules/:.syarn完整性中

仅在yarn_node_modules/:ansi 中

仅在yarn_node_modules/:ansistyles 中

仅在yarn_node_modules/:archy 中

仅在yarn_node_modules/中:异步一些

仅在yarn_node_modules/:内置中

仅在yarn_node_modules/:字符微调器中

仅在yarn_node_modules/:chmodr 中

仅在yarn_node_modules/:chownr 中

仅在yarn_node_modules/:cmd填充程序中

仅在yarn_node_modules/中:列化

仅在yarn_node_modules/:配置链中

仅在yarn_node_modules/:debuglog 中

仅在yarn_node_modules/中:默认

仅在yarn_node_modules/:dezalgo 中

仅在yarn_node_modules/:dom存储中

仅在yarn_node_modules/:编辑器中

仅在yarn_node_modules/:esprima 中

仅在yarn_node_modules/:fs真空中

仅在yarn_node_modules/:fs中写入流原子

仅在yarn_node_modules/:fstream中忽略

仅在yarn_node_modules/:fstream npm 中

仅在git 的yarn_node_modules/:github url中

仅在用户名repo 的yarn_node_modules/:github url中

仅在yarn_node_modules/:ic ajax 中

仅在yarn_node_modules/:ifer 中

仅在yarn_node_modules/:init包json 中

仅在yarn_node_modules/:jju 中

仅在yarn_node_modules/:json解析中有帮助错误

仅在yarn_node_modules/:锁定文件中

仅在yarn_node_modules/:lodash.pad 中

仅在yarn_node_modules/:lodash.padd 中

仅在yarn_node_modules/:lodash.padstart 中

仅在yarn_node_modules/:normalize git url 中

仅在yarn_node_modules/:npm缓存文件名中

仅在yarn_node_modules/:npm中安装检查

仅在yarn_node_modules/:npm注册表客户端中

仅在yarn_node_modules/:npm中用户验证

仅在yarn_node_modules/:opener 中

仅在yarn_node_modules/中:路径在内

仅在yarn_node_modules/:promzard 中

仅在yarn_node_modules/:proto列表中

仅在yarn_node_modules/中:读取

仅在yarn_node_modules/中:读取已安装的

仅在yarn_node_modules/中:读取包json

仅在yarn_node_modules/:readdir范围内的模块中

仅在yarn_node_modules/中:实现包说明符

仅在yarn_node_modules/中:重试

仅在yarn_node_modules/:sha 中

仅在yarn_node_modules/:sigmund 中

仅在yarn_node_modules/:排序对象中

仅在yarn_node_modules/:文本表中

仅在yarn_node_modules/:uid编号中

仅在yarn_node_modules/:umask 中

仅在yarn_node_modules/中:验证npm包名称

仅在yarn_node_modules/:wcwidth 中


在清理阶段,默认情况下,Yarn会删除很多包。Ember-cli qunit需要运行images目录,但默认情况下会将其删除。

更新.yarnclean文件并替换行:

图像

带有

!;图像

这将留下所有的映像目录,如果您需要更多的特殊性,您可以细化regexp。

我遇到了同样的事情。我找到了另一个解决方法,将ember-cli qunit降级回v1.4.0,也允许使用yarn构建模块。

最新更新