javascript - Unable to resolve path to module 'threeaddonsmiscTimer.js' - Stack Overflow

admin2025-04-17  2

I’m trying to create a timer in THREE.js. All the libraries are installed through NPM and the seem to be correctly installed, I’ve created a scene and loaded an object with a GLTFLoader. Orbit controls also all seem to be working correctly. Other modules are importing correctly eg:

import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

But when I enter: import { Timer } from 'three/addons/misc/Timer.js'; I get the error `Unable to resolve the path to module 'three/addons/misc/Timer.js'. I’ve tried looking in the node_moduls folder, in the three folder. But I can’t even find the addons folder. So I’m a bit confused. Can anyone tell me what I’m doing wrong?

转载请注明原文地址:http://anycun.com/QandA/1744890827a89082.html