6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Node.js】Error: error:0308010C:digital envelope routines::unsupported【エラー】

Last updated at Posted at 2021-11-07

##発端
https://ja.reactjs.org/docs/create-a-new-react-app.html#create-react-app
create-react-appしてnpm startを叩いても開発サーバーが起動しないというエラーにハマったのでメモ

##環境
macOS Catalina v10.15.6
Node.js v17.0.1

##エラー

Starting the development server...

/Users/xxxx/xxxx/React_Practice/my-app/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/Users/xxxx/xxxx/React_Practice/my-app/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/xxxx/xxxx/React_Practice/my-app/node_modules/webpack/lib/NormalModule.js:417:16)
    at /Users/xxxx/xxxx/React_Practice/my-app/node_modules/webpack/lib/NormalModule.js:452:10
    at /Users/xxxx/xxxx/React_Practice/my-app/node_modules/webpack/lib/NormalModule.js:323:13
    at /Users/xxxx/xxxx/React_Practice/my-app/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /Users/xxxx/xxxx/React_Practice/my-app/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/Users/xxxx/xxxx/React_Practice/my-app/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /Users/xxxx/xxxx/React_Practice/my-app/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.0.1

##原因
https://github.com/webpack/webpack/issues/14532
どうやらNode.jsの最新バージョン(2021/11/07時点 v17.0.1)が対応していなかったらしいです。

##対処法
Node.jsのバージョンを下げる。
推奨版(2021/11/07時点 v16.13.0)に切り替えて再度npm startしたら無事に開発サーバーが起動しました。めでたしめでたし。

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?