import * as THREE from 'three.js'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth,window.innerHeight);
document.body.appendChild(renderer.domElement);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(
75,
window.innerWidth/window.innerHeight,
0.1,
1000
);
const orbit = new OrbitControls(camera,renderer,domElement);
const axesHelper = new THREE.AxesHelper(5);
scene.add(axesHelper);
camera.position.set(0,2,7.5);
orbit.update();
const boxGeometry = new THREE.BoxGeometry();
const boxMaterial = new THREE.MeshBasicMaterial({color:0x00ff00});
const box = new THREE.Mesh(boxGeometry,boxMaterial);
scene.add(box);
box.rotation.x = 5;
box.rotation.y = 5;
function animate(){
box.rotation.x += 0.01;
box.rotation.y += 0.01;
renderer.render(scene,camera);
}
renderer.setAnimationLoop(animate);
enter image description here I keep getting error when i want to import three and orbitcontrols.js, but i have already npm install them and they are inside the node_modules file, what should i do in order to make it work?