You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/7/en/part7e.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -317,7 +317,35 @@ One year old project that is used by the [part 9](/en/part9) of his course alrea
317
317
318
318

319
319
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.
321
349
322
350
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.
Copy file name to clipboardExpand all lines: src/content/7/fi/osa7e.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -318,7 +318,36 @@ Vuoden vanha [osassa 9](/osa9) käytetty projekti sisältää jo aika paljon van
318
318
319
319

320
320
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:
Seuraavaksi ajantasaistetaan riippuvuudet suorittamalla komento _npm install_. Riippuvuuksien vanhat versiot eivät tietenkään välttämättä ole tietoturvariski.
322
351
323
352
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.
0 commit comments