DEV Community

Discussion on: How to create a basic npx command-line library

Collapse
 
densevoid profile image
Alexander Reflector

For some reason, at the first stage, it displays this:

npx test-cli-tool

npm ERR! code E404
npm ERR! 404 Not Found - GET registry.npmjs.org/test-cli-tool - Not found
npm ERR! 404
npm ERR! 404 'test-cli-tool@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Collapse
 
9zemian5 profile image
Oleksandr Demian

Hi Alexander,
Sorry for the late response, you have to install this repository in order to execute it. Try to run npm i -g from the root folder of your project. It will install your tool locally, and then you will be able to execute it from CLI using npx <your-tool-name>.

Let me know if it helped you 😀

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi

You should update it

Collapse
 
ashirbadgudu profile image
Ashirbad Panigrahi
npx . 
Enter fullscreen mode Exit fullscreen mode

will work