add the old snippet md files
This commit is contained in:
parent
fc0dd204c7
commit
bcf8313a4b
110 changed files with 3048 additions and 0 deletions
33
old_snippets/update-npm-packages.en.md
Normal file
33
old_snippets/update-npm-packages.en.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
title: "update npm packages to latest versions"
|
||||
seo_description: "How to update the node modules of a project to their latest version"
|
||||
date: 2022-06-15T09:28:28+02:00
|
||||
draft: false
|
||||
snippet_types:
|
||||
- npm
|
||||
- js
|
||||
- node
|
||||
---
|
||||
|
||||
I was doing some housekeeping on a Node.JS project today. Wanted to update all
|
||||
the dependencies to their latest versions. At first I tried `npm update` but
|
||||
come to find out that is ment more for upgrading single packages and not
|
||||
major versions. In the end after some googling I found
|
||||
[npm-check-updates](https://www.npmjs.com/package/npm-check-updates).
|
||||
|
||||
To upgrade the dependencies of a project without installing anything else I ran:
|
||||
|
||||
```shell
|
||||
$ npx npm-check-updates -u
|
||||
```
|
||||
|
||||
It updated the **package.json** so it must be followed up by a:
|
||||
|
||||
|
||||
```shell
|
||||
$ npm i
|
||||
```
|
||||
|
||||
Which will install the new packages and update the **package-lock.json**.
|
||||
|
||||
[source](https://nodejs.dev/learn/update-all-the-nodejs-dependencies-to-their-latest-version)
|
||||
Loading…
Add table
Add a link
Reference in a new issue