Ember-CLI对jQuery和QUnit使用了错误的路径

时间:2015-12-22 15:10:34

标签: ember.js ember-cli

我正在使用以下版本的全新ember-cli安装:

~/Projects/ember_tut > ember s
version: 1.13.13
node: 4.2.1
npm: 2.14.10
os: darwin x64

bower.json看起来像这样:

{
  "name": "ember-tut",
  "dependencies": {
    "ember": "1.13.11",
    "ember-cli-shims": "0.0.6",
    "ember-cli-test-loader": "0.2.1",
    "ember-data": "1.13.15",
    "ember-load-initializers": "0.1.7",
    "ember-qunit": "0.4.16",
    "ember-qunit-notifications": "0.1.0",
    "ember-resolver": "~0.1.20",
    "jquery": "^1.11.3",
    "loader.js": "ember-cli/loader.js#3.4.0",
    "qunit": "~1.20.0",
    "pretender": "~0.10.1",
    "lodash": "~3.7.0",
    "Faker": "~3.0.0"
  }
}

运行ember new ember_test后立即

~/Projects/ember_tut > ember s
version: 1.13.13
Livereload server on http://localhost:49154
Serving on http://localhost:4200/
ENOENT: no such file or directory, stat '/Users/sms/Projects/ember_tut/tmp/concat_with_maps-input_base_path-pmZyxQ2F.tmp/0/bower_components/jquery/dist/jquery.js'
Error: ENOENT: no such file or directory, stat '/Users/sms/Projects/ember_tut/tmp/concat_with_maps-input_base_path-pmZyxQ2F.tmp/0/bower_components/jquery/dist/jquery.js'
    at Error (native)
    at Object.fs.statSync (fs.js:849:18)
    at ConcatWithMaps.keyForFile (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:90:20)
    at Array.map (native)
    at ConcatWithMaps.CachingWriter._conditionalBuild (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:112:65)
    at /Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/read_compat.js:61:34
    at lib$rsvp$$internal$$tryCatch (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:505:17)
    at lib$rsvp$$internal$$publish (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:476:11)
    at lib$rsvp$asap$$flush (/Users/sms/Projects/ember_tut/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9)

它在jquery.js中寻找bower_components/jquery/dist/jquery.js,但它确实位于bower_components/jquery/jquery-1.11.3/dist/jquery.js

通过在bower_components/jquery/bower_components/jquery/jquery-1.11.3/dist中创建一个符号链接可以轻松“修复”这个问题,但这非常笨拙,而且我想知道解决问题的正确方法是什么。

1 个答案:

答案 0 :(得分:1)

我发现删除所有npm和bower缓存,然后重新安装所有工作,这让我觉得nem在评论中的建议非常接近:

npm cache clear && bower cache clean && rm -rf node_modules bower_components && npm install && bower install