构建失败,因为无法加载三个目录的路径
我正在尝试遵循本教程,但是我的构建失败了此错误消息:
[!] 错误:无法加载 C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\ Three\examples\jsm\controls\OrbitControls (由 app.js 导入):ENOENT:没有这样的文件或目录, 打开'C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\三\examples\jsm\controls\OrbitControls'
此文件在这些行的第一行中导入
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
import { IFCLoader } from "web-ifc-three/IFCLoader";
尝试解决它:
- 将 .js 添加到两个路径的末尾投掷
[!] 错误:无法加载 C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\third\examples\jsm\utils\BufferGeometryUtils(由 node_modules\web-ifc- Three\IFCLoader.js 导入) :ENOENT: 没有那个文件或目录,打开'C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\三\examples\jsm\utils\BufferGeometryUtils'
- 在路径开头添加 node_module/ 让我可以构建,但在执行时会抛出此错误
未捕获类型错误:无法解析模块说明符“node_modules/two/examples/jsm/controls/OrbitControls”。相对引用必须以“/”、“./”或“../”开头。
I'm trying to follow this tutorial, however my build fails due to this error message:
[!] Error: Could not load C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\three\examples\jsm\controls\OrbitControls (imported by app.js): ENOENT: no such file or directory, open 'C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\three\examples\jsm\controls\OrbitControls'
This file is imported in the first of these lines
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
import { IFCLoader } from "web-ifc-three/IFCLoader";
Tried to solve it:
- adding .js to the end of both paths throws
[!] Error: Could not load C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\three\examples\jsm\utils\BufferGeometryUtils (imported by node_modules\web-ifc-three\IFCLoader.js): ENOENT: no such file or directory, open 'C:\Data\Arbeit\BIM\Ausprobieren\ifcTutorialGithub\node_modules\three\examples\jsm\utils\BufferGeometryUtils'
- adding node_module/ at beginning of the path lets me build but throws this when executing
Uncaught TypeError: Failed to resolve module specifier "node_modules/three/examples/jsm/controls/OrbitControls". Relative references must start with either "/", "./", or "../".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论