gpt4 book ai didi

javascript - 浏览器不支持 Node tls 模块

转载 作者:行者123 更新时间:2023-11-30 06:52:47 24 4
gpt4 key购买 nike

我使用 jspm 和 SystemJS 在 npm 中加载一些 Node 模块。其中之一( 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.

谁能帮我解决这个问题?非常感谢。

最佳答案

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

关于javascript - 浏览器不支持 Node tls 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32138320/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com