我在使用three.js为分配工作时遇到问题。我克隆了this repository并使用npm install
下载了依赖项。当我运行服务器并加载页面时,我得到TypeError: THREE.FileLoader is not a constructor
。
这似乎是因为没有FileLoader文件,但我不知道如何解决问题 - 我尝试删除node_module/three
的内容并将其替换为最新{{3} },但那给了我Uncaught Error: Cannot find module "three"
。
我不知道为什么运行npm install
没有给我更新版本的three.js并给了我不会运行的代码。我如何解决我的问题?
答案 0 :(得分:0)
使用"three": "0.82.1"
无法使用FileLoader
只需将three.js
版本更新为"three": "^0.84.0"
中的package.json
,然后再次运行npm i