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

258
Visualizações
Node Command Line Tool with NVM bash:not found

I am writing a simple node CLI tool and having trouble using with NVM. Even installed node locally and use nvm use system and the CLI file still cannot be found. Code is simply including the shell designation:

#!/usr/bin/env node

console.log("Hello, here is my first CLI tool")

When running this from command line I get this: -bash: cli-project: command not found

Have tried everything. Node is at /usr/local/bin/node, and have even added that. Have used system location of node. Have added the path to /etc/paths. Nothing works! Does anyone have experience building a node CLI tool using NVM how to set up initially? NVM is set up correctly on my machine, and .bash_profile is fine. Very puzzling why it won't pick up this simple path to this.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You have to do a little package.json magic in addition to the shebang it seems like so:

"bin": {
    "cli-project": "index.js"
  },

Then do npm link . in the application directory. Works!

about 4 years ago · Juan Pablo Isaza 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