我使用 jspm 和 SystemJS 在 npm 中加载一些节点模块。其中之一(docker-api-wrapper)在其中使用了请求模块。所以当我试图在浏览器上运行它时,它总是抛出一个异常,比如
Error loading "npm:docker-api-wrapper@0.2.9"
at http: //localhost:58063/lib/npm/docker-api-wrapper@0.2.9.js
Error loading "npm:docker-api-wrapper@0.2.9"
from "js/site"
at http: //localhost:58063/js/site.js
Error evaluating http: //localhost:58063/lib/npm/docker-api-wrapper@0.2.9.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/docker-api-wrapper@0.2.9/index.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/docker-api-wrapper@0.2.9/lib/DockerApi.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/docker-api-wrapper@0.2.9/lib/utils.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/request@2.61.0.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/request@2.61.0/index.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/request@2.61.0/request.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/forever-agent@0.6.1.js
uncaught exception: Error evaluating http: //localhost:58063/lib/npm/forever-agent@0.6.1/index.js
uncaught exception: Error evaluating http: //localhost:58063/lib/github/jspm/nodelibs-tls@0.1.0.js
uncaught exception: Error evaluating http: //localhost:58063/lib/github/jspm/nodelibs-tls@0.1.0/index.js
uncaught exception: Node tls module not supported in browsers.
es6 - mod...ader.js(line 7)
uncaught exception: Node tls module not supported in browsers.
uncaught exception: Error evaluating http: //localhost:58063/lib/github/jspm/nodelibs-tls@0.1.0/index.js
uncaught exception: Node tls module not supported in browsers.
有人可以帮我吗?非常感谢。