未找到 TextGeometry.js 和 FontLoader.js 依赖项
TextGeometry.js and FontLoader.js dependencies were not found
我使用 Trois.js 创建 Vue.js+Three.js 应用程序。我安装了 Trois.js
库:
npm install three@0.127 troisjs
我将一些基本元素导入到我的 Vue 模块中,就像 Renderer
、Scene
等
import {Renderer, Scene, Camera, Sphere} from 'troisjs'
当我 运行 npm run serve
然后错误出现:
These dependencies were not found:
- three/examples/jsm/geometries/TextGeometry.js in ./node_modules/troisjs/build/trois.module.js
- three/examples/jsm/loaders/FontLoader.js in ./node_modules/troisjs/build/trois.module.js
有趣的是,TextGeometry 和 FontLoader 存在于上述目录下的 node_modules 中:
..build/trois.module.js
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js';
import { FontLoader } from 'three/examples/jsm/loaders/FontLoader.js';
...
我不知道为什么会出现这个错误,我重新安装了 trois.js
软件包,但没有成功。还是不行。这是我的 package.json
文件:
{
"name": "troisapp",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"three": "^0.127.0",
"troisjs": "^0.3.3",
"vue": "^3.0.0",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.0.0",
"prettier": "^2.2.1"
},
"description": "## Project setup ``` npm install ```",
"main": ".eslintrc.js",
"keywords": [],
"author": "",
"license": "ISC"
}
TextGeometry
和 FontLoader
已移至带有 r133
的示例中。意思是 trois.js
希望您使用更新的 three.js
版本而不是 r127
.
我使用 Trois.js 创建 Vue.js+Three.js 应用程序。我安装了 Trois.js
库:
npm install three@0.127 troisjs
我将一些基本元素导入到我的 Vue 模块中,就像 Renderer
、Scene
等
import {Renderer, Scene, Camera, Sphere} from 'troisjs'
当我 运行 npm run serve
然后错误出现:
These dependencies were not found:
- three/examples/jsm/geometries/TextGeometry.js in ./node_modules/troisjs/build/trois.module.js
- three/examples/jsm/loaders/FontLoader.js in ./node_modules/troisjs/build/trois.module.js
有趣的是,TextGeometry 和 FontLoader 存在于上述目录下的 node_modules 中:
..build/trois.module.js
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js';
import { FontLoader } from 'three/examples/jsm/loaders/FontLoader.js';
...
我不知道为什么会出现这个错误,我重新安装了 trois.js
软件包,但没有成功。还是不行。这是我的 package.json
文件:
{
"name": "troisapp",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"three": "^0.127.0",
"troisjs": "^0.3.3",
"vue": "^3.0.0",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.0.0",
"prettier": "^2.2.1"
},
"description": "## Project setup ``` npm install ```",
"main": ".eslintrc.js",
"keywords": [],
"author": "",
"license": "ISC"
}
TextGeometry
和 FontLoader
已移至带有 r133
的示例中。意思是 trois.js
希望您使用更新的 three.js
版本而不是 r127
.