浏览器不支持Node tls模块

时间:2015-08-21 10:42:15

标签: javascript asp.net-mvc node.js jspm systemjs

我使用jspm和SystemJS在npm中加载一些节点模块。其中一个(docker-api-wrapper)在其中使用了request模块。因此,当我尝试在浏览器上运行它时,它总是抛出一个像

这样的异常



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.




有人可以帮我吗?非常感谢你。

1 个答案:

答案 0 :(得分:-2)

我看到你已经发布了这个on the request issue tracker。我认为它可能实际上不受支持。请尝试使用then-request