user5589534
user5589534

Reputation:

Why is the main file of my published npm package not accesible?

I published this pacakge to npm (here's the GitHub repo) and, as you see, the main file in package.json is "men". It looks like I'm missing something because once I download it with npm i -g real-men and type men into the terminal (even after restarting the terminal and doing source /etc/environment ), I get a "men: command not found".

I see, for instance, that the "ng" executable for the Angular CLI has a link in the /bin node folder. Then I thought "hey, maybe I'm missing a step which copies a link to that folder", but I'm still confused and haven't found anything by googling it.

OS: Manjaro x64 (Illyria 18.0.0-rc)

Node: placed in user home folder (tar.gz extracted there, bin folder manually added to PATH)

npm -v: 6.4.1

node -v: v8.12.0

EDIT: I've marked as deprecated the package, by the time being


Solved

Solved by adding this to package.json:

"bin": {
    "men": "./men"
 }

My bad, I was not aware of this property and its uses.

Upvotes: 0

Views: 49

Answers (1)

Daniel Choi
Daniel Choi

Reputation: 194

Maybe try:

npm install

You might have updated the file, but never actually downloaded the dependencies.

Upvotes: 2

Related Questions