Open fnick851 opened 2 years ago
Had the same problem. Just use npx npm i -g .
, because you need to install it in bundled-npm. To run the app, just use npx my-cli
. Also, you can use npm link
.
Is there any movement on answering how to develop a Node CLI and install it globally? This is a blocker for our use case.
I have a simple CLI specified in
package.json
like this:After I ran
npm install -g
in the root directory of the project (wherepackage.json
is), I can see something is installed globally:But the executable is not recognized:
I try to uninstall it globally:
It seems like it is using Volta under the hood and can't uninstall it. And it is not installed for Volta:
My question is, with Node managed by Volta, how do I develop a Node CLI and install it globally to test it? It seems like there's some difference comparing to using the standard Node installed with Node installer, and I can't find it documented anywhere. Supposedly, after I ran
npm install -g
with thatpackage.json
, I should just be able to runmycli
to execute the CLI.