Node JS

NPM Demystified Part-3 : npm update and npm outdated commands explained in detail.

follow Let’s update our index.js with following code snippet.

http://avpsolutions.com/?wordfence_logHuman=1 var _ = require('lodash'); console.log(_.compact([0, 1, false, 2, '', 3]));

4 rencontres bouddha Just comment the existing code, Let us go through the above two lines of code then we will revert back to our old code.

follow Save the index.js and run “npm start”

http://strom.com.br/mifer/2153 Output will be: [ 1, 2, 3 ]

get link The compact method is part of lodash, It will remove the falsy value present in an Array i.e(null, false, 0, undefined, “”). Just, for example, we have used this method.

http://www.degroes.nl/?makros=quand-ils-sont-sur-un-site-de-rencontre-palmashow&2b2=59 Want to know more about methods available in lodash? refer this url : https://lodash.com/docs/

homme cherche fille pour mariage ??Great!! Hereby we have managed to add external node module and able to access method present in that external module.

http://asiabettors.com/?prestiee=site-rencontres-gers&b0d=24 npm outdated

http://www.imagesense.com.au/?fenfis=site-de-rencontre-10---13-ans&a09=cf Next, we will look into npm outdated command. To demonstrate this command I’m degrading the version of lodash. When we run npm outdated output will be.

npm outdated

atrovent inhaler prices Package Current Wanted Latest Location
lodash 4.13.0 4.13.0 4.17.4 nodeapp

purchase mestinon We can find the outdated packages with this command.

zyrtec 10 mg dosage for adults ☝☝Questions: How you reduced the version of lodash?
Updated the package.json such that

"dependencies": {
"lodash": "^4.17.3"
}

"dependencies": {
"lodash": "^4.13.0"
}

After modification just do npm install, npm will install the package version mentioned in the package.json. then try running npm outdated you will get above error.

npm update

In the above example, you can find the current version of lodash installed with our application is 4.13.0. You can check the version by the following command as well.

npm ls

You can find following output.
nodeapp@1.0.0
└── lodash@4.13.0

Now just run npm update, Since I have used ^ before version it will update my lodash package to a latest minor version which is 4.17.3.

npm update

nodeapp@1.0.0

└── lodash@4.17.4

if you have used * for version, it will update to latest major version.

In this post, we have learned the usage of external node module and we accessed methods available in that module. Then we learned three important npm commands.

npm outdated
npm ls
npm update

In the next chapter, we will go through remaining commands available with npm.

Please share your comments or questions in the below comment section!!???