[NodeJS] – How to install dependencies? How works the`npm install`?

Npm is a smart package manager and it will install the latest and compatible with the project tag version as default[1][2]. This command when use with the parameter –save will add the dependence into the package.json file. It is valuable said that the prefix character (^)[4] is added as default too which means for the npm that is for installing a compatible version when you will run the command `npm install`.

Also, you can use the command `$npm update`[3] for automatically update all dependencies for the latest compatible.

Know how works npm and its commands help you avoid issues and a lot of pain.  Also, I’d like to suggest avoid fixed versions directly into the file and always as possible use `$npm update`[3] to update the dependences.  

[1] – https://docs.npmjs.com/cli/install

[2] – https://docs.npmjs.com/misc/config

[3] – https://docs.npmjs.com/cli/update

[4] – https://docs.npmjs.com/files/package.json

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s