Skip to content

Commit 2ca97f2

Browse files
authored
Merge branch 'fullstack-hy2020:source' into source
2 parents 3f82908 + 24ccee3 commit 2ca97f2

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
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

src/content/7/fi/osa7e.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,36 @@ Vuoden vanha [osassa 9](/osa9) käytetty projekti sisältää jo aika paljon van
318318

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

321-
Riippuvuudet saa ajantasaistettua päivittämällä tiedostoa <i>package.json</i> ja suorittamalla komennon _npm install_. Riippuvuuksien vanhat versiot eivät tietenkään välttämättä ole tietoturvariski.
321+
Riippuvuudet saa ajantasaistettua päivittämällä tiedostoa <i>package.json</i>. Sitä helpottaa [npm-check-updates](https://www.npmjs.com/package/npm-check-updates)-niminen työkalu, joka asennetaan globaalisti komennolla
322+
323+
```bash
324+
npm install -g npm-check-updates
325+
```
326+
Tämän työkalun avulla tarkistetaan riippuvuuksien ajantasaisuus seuraavasti:
327+
```console
328+
$ npm-check-updates
329+
Checking ...\ultimate-hooks\package.json
330+
[====================] 9/9 100%
331+
332+
@testing-library/react ^13.0.0 → ^13.1.1
333+
@testing-library/user-event ^14.0.4 → ^14.1.1
334+
react-scripts 5.0.0 → 5.0.1
335+
336+
Run ncu -u to upgrade package.json
337+
```
338+
Tiedosto <i>package.json</i> päivitetään suorittamalla komento _ncu -u_.
339+
```console
340+
$ ncu -u
341+
Upgrading ...\ultimate-hooks\package.json
342+
[====================] 9/9 100%
343+
344+
@testing-library/react ^13.0.0 → ^13.1.1
345+
@testing-library/user-event ^14.0.4 → ^14.1.1
346+
react-scripts 5.0.0 → 5.0.1
347+
348+
Run npm install to install new versions.
349+
```
350+
Seuraavaksi ajantasaistetaan riippuvuudet suorittamalla komento _npm install_. Riippuvuuksien vanhat versiot eivät tietenkään välttämättä ole tietoturvariski.
322351

323352
Riippuvuuksien turvallisuus voidaan tarkistaa npm:n [audit](https://docs.npmjs.com/cli/audit)-komennolla, joka vertaa käytettyjen riippuvuuksien versioita keskitetyssä virhetietokannassa listattuihin tietoturvauhan sisältäviin riippuvuuksien versioihin.
324353

0 commit comments

Comments
 (0)