【问题标题】:Why i can't requrie SceneExporter in node.js?为什么我不能在 node.js 中要求 Scene Exporter?
【发布时间】:2014-07-29 06:46:54
【问题描述】:

大家好,我有一个问题,当我想在 node.js 中使用 SceneExporter 时,我遇到了 require 它的一些问题,我将展示示例:

THREE = require 'three' - here i include module which i instaled to node.js
Export = require './SceneExporter.js'  -  here is js

错误: 三.SceneExporter = function () {}; ^ ReferenceError: 三个未定义

如何在 node.js 中使用它?

也许这里有 1 个以前做过。

当我尝试从文件中包含三个.js 时,更重要的是:

THREE = require './three.js'

我收到其他错误:

/home/name/NetBeansProjects/SerwerNode/src/three.js:26561
self._typeface_js = { faces: THREE.FontUtils.faces, loadFace: THREE.FontUtils.
^
ReferenceError: self is not defined

【问题讨论】:

    标签: javascript node.js coffeescript three.js scene


    【解决方案1】:

    我假设你使用这个包的三个.js https://github.com/nulltask/node-three.js

    好吧,它不会解决你的问题,但是对于“为什么你不能要求 SceneExporter ?”的问题

    答案是“因为这个包不是与原始存储库保持同步,或者它根本不包含 SceneExporter 类”

    那么,解决依赖问题的最佳方法是什么? 我还没有答案,但是你应该留意这里相关的three.js问题:https://github.com/mrdoob/three.js/issues/4776

    【讨论】:

      【解决方案2】:

      因为 node.js 不支持 window/self,它们是 Web API。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-06-17
        • 1970-01-01
        • 2016-11-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多