Tuesday 28 April 2020

Help with Node.js and Three.js

Hi everyone, i recently started learning Node along with Three.js and i've been having problems on the setup of my hopefully future website. I apologize in advance if my questions seem dumb but i've been learning for the past 2 months programming in general and i want to get out of the local website scope since i'm already comfortable with those and move on to a "bigger thing". I setup a nodejs server with the help of expressjs and i've been able to load the html part of my website, however the console of my browser doesnt seem to be loading my javascript file because it says `require is not defined`. The first line of my app.js is this `let THREE = require('three');` i created a package.json file inside a folder i created where i stored my html,css and js files. The installation of threejs through npm was successful( BTW, sorry in advance if what i'm doing is a huge oof). Outside of the folder i created a server.js where i installed express.js and used it to create a local server. Idk if the app.js isn't loading because i'm failing at the installation of the three.js library or if it's because i need a bundler which i saw a lot of people using for this purpouse i guess. Anyway, thanks if u got this far into the post. Here is how the whole project looks like https://imgur.com/gallery/lB6Q6W0

Submitted April 29, 2020 at 02:21AM by rogerpeke97

No comments:

Post a Comment