Digi Deck LLC https://digideck.com digideck Consulting Solutions Tue, 29 Nov 2022 18:24:13 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 https://digideck.com/wp-content/uploads/2021/06/digideck-logo.arrows-only.598x197.png Digi Deck LLC https://digideck.com 32 32 npm package major update https://digideck.com/npm-package-major-update/ https://digideck.com/npm-package-major-update/#respond Tue, 29 Nov 2022 18:24:13 +0000 https://digideck.com/?p=2881 npm package major update Read More »

]]>
Many times you will want to upgrade the npm packages for your applications. You can easily do minor upgrades using npm update. But what happens when you want to do a major upgrade of a package that has a major version upgrade? Luckily, we have an automated solution for this so that you do not have to go through the tedium of doing an npm install package-i-want-to-upgrade@latest.

From your command line prompt on Mac or Linux, all you need to do is run the following command:

npm install $(npm outdated | cut -d’ ‘ -f 1 | sed ‘1d’ | xargs -I ‘$’ echo ‘$@latest’ | xargs echo)

This script will first read all of your outdated packages. Then it will append @latest to their name and run each of them individually.

Contratulations! You have now updated your project to the latest of all dependent npm packages with one simple to run command.

]]>
https://digideck.com/npm-package-major-update/feed/ 0