I learned 3D JavaScript via the YouTube tutorial — “Three.js Tutorial For Absolute Beginners” — https://www.youtube.com/watch?v=xJAfLdUgdc4&list=PLjcjAqAnHd1EIxV4FSZIiJZvsdrBc1Xho.
The tutuorial use npm. What I’ve learned:
… npm init -y
[install a bundler]
… npm install parcel --save-dev
[takes a while]
[I create an index.html file]
[install threejs]
… npm install three
[I create a script.js file]
… npx parcel src/index.html
[provides a local link … an example → Server running at http://localhost:1234/ (link via Chrome)]
[ctrl+C regains Terminal control]
… npm install dat.gui
[when I exit VS Code, and restart, I enter the npx again]
… npx parcel src/index.html
This works well. However, when I click on the html, it does not work.
How do I get a program (npm) to run, when I click on the html?