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

257
Views
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 answers
Answer question

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 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!