Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何开始使用yeoman和three.js?_Node.js_Three.js_Gruntjs_Yeoman_Bower - Fatal编程技术网

Node.js 如何开始使用yeoman和three.js?

Node.js 如何开始使用yeoman和three.js?,node.js,three.js,gruntjs,yeoman,bower,Node.js,Three.js,Gruntjs,Yeoman,Bower,我用bower安装threejs安装了three.js 然后,我希望我的页面中有三个.js,因此我的app.js文件以: define(["jquery", "three"], function() { "use strict"; 但是,当我的页面加载时,Chrome控制台显示: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/scrip

我用
bower安装threejs
安装了three.js

然后,我希望我的页面中有三个.js,因此我的app.js文件以:

define(["jquery", "three"], function() {
  "use strict";
但是,当我的页面加载时,Chrome控制台显示:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/scripts/three.js
Uncaught Error: Script error
那么,它不应该像jQuery一样在组件中查找吗


基本上,我如何开始使用yeoman并安装three.js?

解决方案如下

app.js文件需要如上所述引用“三个”,这是指main.js文件,该文件具有以下内容

require.config({
    paths: {
        jquery: '../components/jquery/jquery',
        three: '../components/threejs/build/three'
    },
    shim: {
        bootstrap: {
            deps: ['jquery'],
            exports: 'jquery'
        }
    }
});
这里的关键是threejs three.js文件所在的三个点