如何调试systemJS错误将js加载为“”

时间:2018-04-19 09:46:17

标签: npm aurelia systemjs jspm

我收到以下错误:

system.src.js:123 Uncaught (in promise) Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:8000/dist/jquery.js
    Error: XHR error (404 Not Found) loading http://localhost:8000/dist/jquery.js
    Error loading http://localhost:8000/dist/jquery.js as "jquery" from http://localhost:8000/jspm_packages/npm/toastr@2.1.2/toastr.js

我该如何解决这个问题?

我已完成npm installjspm install

谢谢!

1 个答案:

答案 0 :(得分:2)

您需要确保jquery映射到node_modules中的正确路径,并且依赖于jquery的任何模块都明确声明了依赖项:

map: {
  'jquery' : 'path_to_jquery'
},
meta: {
  'file_that depends_on_jquery' : {
    deps: ['jquery']
  }
}