Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

429
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda