Getting Started with npm (Node Package Manager)
NPM, the most used devtool for every JavaScript developer - Dev P Academy
Consider npm to be your outright manager, that manages your node packages on each and every project.
Prerequisite
In taking this course, it is expected that you have taken the course on Node.js and have passed above average the quick assessment in it. If not, click here.
Simple command to know regarding npm
PS: This commands can be run on a single package by specifying the package after the npm command. i.e.:
npm install solid-bootstrap
This would add solid-bootstrap to your packages dependencies in the package.json and install this package to the node_modules folder in your project / folder directory.
npm commands cheat-sheet.
command | usage | shorthand |
npm install | install node packages as they are specifies in the package.json file within a folder or project directory | npm i |
npm uninstall | uninstalls installed node pakages from node_module folder and delete dependency from the package.json file, within directory | npm un |
npm update | updates node packages | npm up |
npm run | To run scripts / commands | npm run |
If a package name is not defined after the command, it reads the package.json file in the project / folder directory for execution.
npm flags
npm flags are command configurations that can be added to npm commands to carry put specific tasks. They are denoted by an - in front of them. i.e.:
npm -g