August, 2019
So we installed NodeJS on our machine.
Because there is already a lot of code out there in the internet, we can use other peoples’ code so we do not have to reinvent the wheel to solve problems, that are already solved.
In order to easily get solutions from other people, we can use a tool called npm.
This will be a short intro to npm with the most used commands. If you want to learn some advanced concepts, read the npm documentation.
If you already installed NodeJS, you already have npm on your machine.
To check, if npm is installed:
npm --version
Most of the time, you want to use packages project-wise.
npm init
. This will create a package.json
file, where all your settings will be saved.package name
, version
etc. You can read about the correct answers herenpm install chalk
. If you want to see all the possibilities how to npm install
a package, read the npm install docs.If you want to learn additional commands, e.g. uninstall a package, read the documentation
Hi! I'm Michael 👋 I'm a Mentor & Educator & Senior Web Developer - I help you to reach your (career) goals.