Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

374
Views
Which command to use for "compiling" a new NPM project?

I'm making a simple JS website using Three.js. I started my project this way:

$ npm init
$ npm install three

Where should I write my code that uses Three.js, and what is the npm command I should run to "compile" my script for something to drop in my webserver public_html?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

1 - Run "npm init", it will create package.json file in your package/project directory.

2 - Run "npm install three", it will install the external package and download it into "node_modules" folder.

3 - Create your own .js file. Example {in your package directory}/<yourMainFile>.js. Ensure in the package.json, you change the following attribute "main": "<yourMainFile>.js".

4 - Refer to "three" package usage in https://www.npmjs.com/package/three. and then write the sample code in <yourMainFile>.js

5 - If you want to test the result, run: $ node ./<yourMainFile>.js

  • Use "./" if git bash cli.

6- If inside <yourMainFile>.js file contain console.log("hello or what ever result you want to display"), then you will see the text display in the console.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!