ember中Could not find module `ember` imported from `mgapp/app问题解决

濮阳和泰
2023-12-01

出现这个错误在编译的时候完全没有问题,当你在浏览器加载的时候控制台就会报这个错误。解决办法是将bower.json文件中的  "jquery": "^1.11.3"中的“^”去掉变成 "jquery": "1.11.3"。

原始的bower.json文件如下:

{
  "name": "borrow",
  "dependencies": {
    "ember": "1.13.7",
    "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
    "ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
    "ember-data": "1.13.8",
    "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
    "ember-qunit": "0.4.9",
    "ember-qunit-notifications": "0.0.7",
    "ember-resolver": "~0.1.18",
    "jquery": "^1.11.3",
    "loader.js": "ember-cli/loader.js#3.2.1",
    "qunit": "~1.18.0"
  }
}

然后变成如下:

{
  "name": "borrow",
  "dependencies": {
    "ember": "1.13.7",
    "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
    "ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
    "ember-data": "1.13.8",
    "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
    "ember-qunit": "0.4.9",
    "ember-qunit-notifications": "0.0.7",
    "ember-resolver": "~0.1.18",
    "jquery": "1.11.3",
    "loader.js": "ember-cli/loader.js#3.2.1",
    "qunit": "~1.18.0"
  }
}

然后执行bower cache clean命令,等命令执行完毕后再执行bower install 然后重新启动ember server就ok了

转载于:https://www.cnblogs.com/ywnwa/p/5533579.html

 类似资料: