When you install a node.js package, you get the latest version. But, what if you need to get the latest version of the packages in an old project? Let me show you how I do it
Imagine, Below is what we’ve in the package.json
of a project –
{
"name": "projects_sass",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"dependencies": {
"gulp": "^4.0.2"
},
"devDependencies": {
"gulp-autoprefixer": "^7.0.1",
"gulp-cssbeautify": "^2.0.1",
"gulp-sass": "^4.1.0",
"node-sass": "^4.14.1"
},
"author": "WickeDev",
"license": "ISC"
}
Now, We run the npm outdated
to find out the new releases of the packages.
To update the packages to the latest version, We need to install the npm-check-updates
package globally.
npm install -g npm-check-updates
Now we just run this command –
ncu -u
Above command will change the version to the latest in the package.json
file. Then we just have to run this command to update the package files –
npm update
That’s it! We’ve all our node.js dependencies updated to the latest version.
Today I will share a snippet I've used in a project. Using that function, you…
JavaScript AJAX (Asynchronous JavaScript and XML) is a technique that gives the ability to send…
By default, Bootstrap carousel has no way to add animations to carousel elements. Here I'm…
Laravel comes up with a paginator that generates HTML compatible with the Tailwind CSS framework.…
Bootstrap introduced their icons collection in November 2019 as Bootstrap Icons (v1.0.0-alpha). At that time,…
To create autocomplete feature for input field(s), HTML's datalist tag can be the easiest solution.…