![](https://file.jishuzhan.net/article/1786352881729802241/d4ac979877f1684ff2685ab4c8ca1900.webp)
部署方式
部署之前请确保已经配置好node.js环境。
1. 下载ThreeJS源码
ThreeJS的GitHub地址:GitHub - mrdoob/three.js: JavaScript 3D Library.,可以简单查看ThreeJS当前版本:r164,
![](https://file.jishuzhan.net/article/1786352881729802241/3055c0fd3cd23084f0f80fdcdf38750a.webp)
我们可以选择对应的版本(此处为r164),点击"release"查看更新日志(Release r164 · mrdoob/three.js · GitHub);通过Git或者下载zip压缩包的方式,获取ThreeJS源码包。
![](https://file.jishuzhan.net/article/1786352881729802241/e7348649d9b8061389b3f23b3fb0fef0.webp)
例如,使用Git获取源码,命令为:
bash
git clone https://github.com/mrdoob/three.js.git
![](https://file.jishuzhan.net/article/1786352881729802241/7313dcadacd7829e46682f27daa4e0fe.webp)
耐心等待拉取完毕即可,
目录结构
2. 安装依赖
使用++npm install
++命令安装依赖。
![](https://file.jishuzhan.net/article/1786352881729802241/089f50c42d6375d96b05f65c9a334836.webp)
3. 启动项目,完成部署
启动命令:++npm start++,
![](https://file.jishuzhan.net/article/1786352881729802241/52800d6608cbff873bc2567949da9743.webp)
默认启动在8080端口,
![](https://file.jishuzhan.net/article/1786352881729802241/367d55e582d6ed9a54dcc26bd21b851b.webp)
打开页面如下,