Skip to content

Commit 8464c45

Browse files
authored
Merge pull request #1971 from kkiilas/patch-60
Update part7e.md
2 parents 5fb3659 + 982447a commit 8464c45

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

src/content/7/en/part7e.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,35 @@ One year old project that is used by the [part 9](/en/part9) of his course alrea
317317

318318
![](../../images/7/33x.png)
319319

320-
The dependencies can be brought up to date by updating the file <i>package.json</i> and running the command _npm install_. However, old versions of the dependencies are not necessarily a security risk.
320+
The dependencies can be brought up to date by updating the file <i>package.json</i>. The best way to do that is by using a tool called _npm-check-updates_. It can be installed globally by running the command
321+
```bash
322+
npm install -g npm-check-updates
323+
```
324+
Using this tool, the up-to-dateness of dependencies is checked in the following way:
325+
```console
326+
$ npm-check-updates
327+
Checking ...\ultimate-hooks\package.json
328+
[====================] 9/9 100%
329+
330+
@testing-library/react ^13.0.0 → ^13.1.1
331+
@testing-library/user-event ^14.0.4 → ^14.1.1
332+
react-scripts 5.0.0 → 5.0.1
333+
334+
Run ncu -u to upgrade package.json
335+
```
336+
The file <i>package.json</i> is brought up to date by running the command _ncu -u_.
337+
```console
338+
$ ncu -u
339+
Upgrading ...\ultimate-hooks\package.json
340+
[====================] 9/9 100%
341+
342+
@testing-library/react ^13.0.0 → ^13.1.1
343+
@testing-library/user-event ^14.0.4 → ^14.1.1
344+
react-scripts 5.0.0 → 5.0.1
345+
346+
Run npm install to install new versions.
347+
```
348+
Then it is time to update the dependencies by running the command _npm install_. However, old versions of the dependencies are not necessarily a security risk.
321349

322350
The npm [audit](https://docs.npmjs.com/cli/audit) command can be used to check the security of dependencies. It compares the version numbers of the dependencies in your application to a list of the version numbers of dependencies containing known security threats in a centralized error database.
323351

0 commit comments

Comments
 (0)