Node.js help with three.js

Hi everyone, im trying to learn node.js and three,js to use them in my project, i created an app.js file and in the html, im referencing the script to app.js.
the first line i wrote in app.js is let THREE = require('three');, i already installed the npm lib of three.js but my question is the next one, im using liveserver from visual studio code and of course im getting an error since it doesnt recognize the recquire command, should i run a server on node.js so that i can see the changes in real time in the browser? if so, How? I have no idea if the way im referencing stuff in my code is ok. I read that i need to create a package.json file but is that necessary if i already installed the lib globally on my node and im referencing it in the app.js file? Thanks and sorry for the long text