【问题标题】:about running WEB Rtc sample关于运行 WEB Rtc 示例
【发布时间】:2021-08-11 07:37:50
【问题描述】:

我从google Lab 克隆了文件,上面写着尝试现场演示。 然后我安装了 npm 并尝试找到触发程序启动的 index.js,但是 gulpfile.babel.js / nightwatch.conf.js 文件很少。

在尝试这个演示版本之前,我按照googleTryCodeLab 的步骤进行操作,在 index.js 中,以“use strict”开头。所以我在 gulpfile.babel.js 中找到了该代码并尝试了

节点 gulpfile.babel.js

它会产生错误,即

从 'gulp' 导入 gulp; ^^^^^^

SyntaxError: 不能在模块外使用 import 语句 在 Object.compileFunction (节点:vm:355:18) 在 wrapSafe (node:internal/modules/cjs/loader:1022:15) 在 Module._compile (node:internal/modules/cjs/loader:1056:27) 在 Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10) 在 Module.load (node:internal/modules/cjs/loader:972:32) 在 Function.Module._load (节点:internal/modules/cjs/loader:813:14) 在 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) 在节点:internal/main/run_main_module:17:47

E:\webRtcProject\test\example\samples>节点 index.js node:internal/modules/cjs/loader:927 throw err;

还有其他方法可以启动这个演示版吗??

【问题讨论】:

    标签: javascript node.js webrtc simplewebrtc


    【解决方案1】:

    示例存储库是独立 HTML/JS 页面的集合。你可以通过一个简单的 HTTP 服务器来测试它们,比如 python -m SimpleHTTPServer

    https://codelabs.developers.google.com/codelabs/webrtc-web#2 的 WebRTC 代码实验室是另一回事。

    【讨论】:

    • 这就是为什么我不能被其他js运行...谢谢帮助!
    猜你喜欢
    • 1970-01-01
    • 2018-03-18
    • 2021-04-09
    • 1970-01-01
    • 2014-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多