
Learning about node modules and their location with npm
Created:08 Jan 2022 16:50:52 , in Host development, Web development
Npm - Node Package Manager - provides some very useful commands for learning about global node modules and where they are stored on the operating system directory tree. This knowledge proves very useful, while juggling Node and npm installations or for testing your new setup looks and works the way it was meant to.
To learn where exactly your node modules are stored, run:
npm root -g
To find out where executables for global node packages are stored, type:
npm bin -g
To list all global packages, type:
npm list -g
To check if a specific module, like yarn, is installed globally type:
npm list yarn -g
To learn details about a node module, like yarn, run:
npm pack yarn -g
To find documentation for a module like yarn, type:
npm docs yarn
This command will open a new web browser tab and load the module's description page on Github. Alternatively you can do this:
npm repo yarn
That's it. I hope the commands will help you to master you Node modules better.
This post was updated on 08 Jan 2022 17:14:57
Tags:
nodejs
Author, Copyright and citation
Author

Author of the this article - Sylwester Wojnowski - is a sWWW web developer. He has been writing computer code for the websites and web applications since 1998.
Copyrights and Citation
Add Comment