解決vue中的'ERR_OSSL_EVP_UNSUPPORTED'錯誤
P粉785522400
P粉785522400 2024-03-25 18:05:41
0
1
373

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

Node.js v17.4.0

執行npm run service時,出現此錯誤。目前node是v16.14.0版本,不斷重裝還是重複同樣的錯誤,因為這些錯誤在node v17中頻繁出現。

"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"
},

如果使用上面的程式碼,是可以執行的,但是用docker建構映像的時候又出現問題了。有解決辦法嗎?

P粉785522400
P粉785522400

全部回覆(1)
P粉738346380

在 Windows 中,我能夠使用以下方法解決此錯誤:

"scripts": {
    "serve": "set NODE_OPTIONS=--openssl-legacy-provider &&  vue-cli-service serve",
    ...
}
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!