To go through the full process, rm the package.json and regenerate it with:
To go through the full process, rm the package.json and regenerate it with:
npm init -y
npm init -y
This makes an empty [package.json](package.json) in this directory. When you install with npm install --save, the names of packages get added to "dependencies" in this file, so that later you can just "npm install" to reinstall all the dependencies (it's like pip + requirements.txt if that sounds familiar).
This makes an empty [package.json](package.json) in this directory. When you install with npm install --save, the names of packages get added to "dependencies" in this file, so that later you can just "npm install" to reinstall all the dependencies (it's like pip + requirements.txt if that sounds familiar).
First install three js with npm, following <https://threejs.org/docs/#manual/en/introduction/Installation>
First install three js with npm, following <https://threejs.org/docs/#manual/en/introduction/Installation>
npm install --save three
npm install --save three
**npm** will create an add the files to node_modules/ folder. Check it out:
**npm** will create an add the files to node_modules/ folder. Check it out:
ls node_modules
ls node_modules
(nb you may sometimes see: **npm i** instead of npm install, it's the same)
(nb you may sometimes see: **npm i** instead of npm install, it's the same)
Install the special orbitcontrols package, following <https://github.com/jameshsu1125/lesca-threejs-orbitcontrols>
Install the special orbitcontrols package, following <https://github.com/jameshsu1125/lesca-threejs-orbitcontrols>
npm install lesca-threejs-orbitcontrols --save
npm install lesca-threejs-orbitcontrols --save
Use webpack to create a browser friendly "bundle", following [the webpack docs](https://webpack.js.org/).
Use webpack to create a browser friendly "bundle", following [the webpack docs](https://webpack.js.org/).