Node.js 17.0.1 Gatsby エラー - 「デジタル エンベロープ ルーチン::サポートされていません... ERR_OSSL_EVP_UNSUPPORTED」 [重複] 質問する

Node.js 17.0.1 Gatsby エラー - 「デジタル エンベロープ ルーチン::サポートされていません... ERR_OSSL_EVP_UNSUPPORTED」 [重複] 質問する

私はギャツビーサイト。Node.jsをアップグレードしてバージョン17.0.1ビルドを実行すると、エラーが発生します。

Error: digital envelope routines::unsupported

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'

v16 にダウングレードすると正常に動作し、ビルドも成功します。どうすればこれを修正できますか?

Google で調べてみると、次のような同様の問題があるようです:エラー: エラー:06065064: デジタル エンベロープ ルーチン:EVP_DecryptFinal_ex: 不正な復号化 #48

ベストアンサー1

これは役に立つかもしれません。これらのスクリプトをパッケージ.jsonファイル。

反応:

"scripts": {
    "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
    "build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
}

Windowsをオンにして を使用している場合は、次のようにスクリプトでの代わりにReact.jsを使用できます。setexport

"scripts": {
    "start": "set SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
    "build": "set SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
}

または

"scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
    "build": "react-scripts --openssl-legacy-provider build",
}

Vue.js:

"scripts": {
    "serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    "build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
},

Windowsをオンにして を使用している場合は、次のようにスクリプトでの代わりにVue.jsを使用できます。setexport

"scripts": {
    "serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    "build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "lint": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
},

または

"scripts": {
    "serve": "vue-cli-service --openssl-legacy-provider serve",
    "build": "vue-cli-service --openssl-legacy-provider build",
    "lint": "vue-cli-service --openssl-legacy-provider lint"
},

角度:

"scripts": {
 "start": "set NODE_OPTIONS=--openssl-legacy-provider  && gulp buildDev && ng serve ",
 "publish": "set NODE_OPTIONS=--openssl-legacy-provider  && gulp build && ng build --prod",
},

おすすめ記事