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

How to I debug systemJS error loading js as "" from

我收到以下错误:

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

谢谢!

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

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