Getting Started with npm (Node Package Manager)

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.

commandusageshorthand
npm installinstall node packages as they are specifies in the package.json file within a folder or project directorynpm i
npm uninstalluninstalls installed node pakages from node_module folder and delete dependency from the package.json file, within directorynpm un
npm updateupdates node packagesnpm up
npm runTo run scripts / commandsnpm 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

References

freecodecamp.org/news/npm-cheat-sheet-most-..

sitepoint.com/npm-guide