install :
$ npm install react-router-dom
# or, for a React Native app
$ npm install react-router-native
If you get below error when you intall react router.
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:68:19)
at Object.createHash (node:crypto:138:10)
at module.exports (C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\util\createHash.js:90:53)
at NormalModule._initBuildHash (C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\NormalModule.js:401:16)
at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\NormalModule.js:433:10
at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\webpack\lib\NormalModule.js:308:13
at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\loader-runner\lib\LoaderRunner.js:367:11
:233:18
at context.callback (C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\loader-runner\l at C:\Dev\WorkSpace\React\Exercise Files\main\react-app\node_modules\babel-loader\lib\index.js:51:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
The Correct (safe) Solution (for npm users)
Use an up-to-date version of Node.js, and also use packages that are up-to-date with security fixes.
For many people, the following command will fix the issue:
npm audit fix --force
'PROGRAMING > React' 카테고리의 다른 글
[REACT] Dark mode Light mode toggle (0) | 2024.03.06 |
---|---|
[REACT]Error: error:0308010C:digital envelope routines::unsupported (0) | 2024.03.06 |
[REACT] What is React? (0) | 2024.02.10 |
[REACT] 'react-scripts' is not recognized (0) | 2024.02.10 |
[REACT] npx create-react-app getting error (1) | 2024.02.10 |