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

424
Views
Why is there a 'js' command on Node JS for Linux?

I've installed on a XUbuntu 13.10 the software Node.js through package manager:

xxx@xxx:/$ sudo apt-get install nodejs

All seems good but along with nodejs executable I've found a js executable.

Both, if called with -v option, show v0.10.15 and I've successfully used both of them as a Javascript interpreter.

My question is: is there any difference between nodejs command and js command? Is js just an alias for the nodejs command?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

It has to do with /etc/alternatives, the Ubuntu/Debian alternatives mechanism.

  • /usr/bin/js — is a link to
  • /etc/alternatives/js — is a link to
  • /usr/bin/node

Thus if you've got /usr/bin in your PATH, running js is effectively exactly the same as running node (except that two symlinks have to be traversed, which is not a significant cost). Using js in scripts (for example) would allow the system to be configured to use an alternative to the installed Node version — maybe a different version, or a version built with some experimental feature.

You can read more about it in the update-alternatives man page.

over 4 years ago · Santiago Trujillo Report

0

js command is a generic command that invokes any javascript interpreter installed on the system.

node command is a command that invokes node.js.

The difference will be if you install another javascript interpreter on your system, it will be linked as /usr/bin/js, but not be in /usr/bin/node obviously.

over 4 years ago · Santiago Trujillo 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!