Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

425
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda