ember broccoli foundation-sites

时间:2016-12-21 14:51:40

标签: node.js ember.js zurb-foundation ember-cli

尝试 ember build ember serve 时,我会收到下一条错误:

Broccoli插件:[SourceMapConcat:Concat:Vendor /assets/vendor.js]失败了:

  

错误:ENOENT:没有这样的文件或目录,stat   ' /用户/ artem_shevtsov / DATA /项目/激光/ UI / TMP /的 source_map_concat-input_base_path-TNdPSywn.tmp /bower_components/foundation-sites/dist/foundation.js'       at Object.fs.statSync(fs.js:906:18)       在FSMonitor._measure(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/heimdalljs-fs-monitor/index.js:66:21)       at Object.statSync(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/heimdalljs-fs-monitor/index.js:82:30)       在Concat.keyForFile(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-caching-writer/index.js:87:20)       在Array.map(本机)       在Concat.CachingWriter._conditionalBuild(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-caching-writer/index.js:109:65)       at /Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-plugin/read_compat.js:93:34       在tryCatch(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:538:12)       at invokeCallback(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:553:13)       在发布时(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:521:7)       在flush(/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:2373:5)       at _combinedTickCallback(internal / process / next_tick.js:67:7)       at process._tickCallback(internal / process / next_tick.js:98:9)

我试过npm和bower cache clean, rm -rf tmp node_modules bower_components 和插件重新安装

还尝试使用npm和bower进行手动安装( npm i foundation-sites,bower install foundation-sites )并添加

  

app.import(' node_modules /基础站点/ DIST / JS / foundation.js')
  app.import(' node_modules /基础站点/ DIST / JS / foundation.min.js&#39)

(或分别为bower_components / ...)但它不起作用

  

❯npm-v
  3.10.9

     

❯节点-v
  V7.2.0

     

❯ember -v
  V7.2.0   ember-cli:2.9.0   节点:7.2.0   os:darwin x64

3 个答案:

答案 0 :(得分:0)

  • 从package.json和bower.json中删除foundationfoundation-sites的条目。
  • npm cahce clean
  • bower cache clean
  • rm -rf tmp node_modules bower_components
  • npm install&&凉亭安装
  • bower安装基础
  • 从ember-cli-build.js中移除其他与相关基础相关的条目,并在app.import('bower_components/foundation-sites/dist/js/foundation.min.js')
  • 下方添加
  • 停止ember服务器并重新启动它。

答案 1 :(得分:0)

  

app.import('bower_components / foundation-sites / dist / foundation.min.js',{       类型:'供应商'     });

类型:'供应商'是成功的秘诀

路径可以不同,取决于基础站点版本

我保留 package.json bower.json 而不做任何更改

答案 2 :(得分:0)

  1. 在bower.json
  2. 中将foundation-sites的版本设置为6.2.2
  3. 运行bower install