Skip to content

node运行报错:opensslErrorStack

问题描述

报错如下:

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

解决方案

  1. 经查:问题原因是因为 node 17版本中的openssl和14版本的不同(老项目原本可以在node14版本下运行的)
  2. 解决方案,找到package.json 文件,加上:set NODE_OPTIONS=--openssl-legacy-provider && 如下:
  "server": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",

在linux环境下,加上:export NODE_OPTIONS=--openssl-legacy-provider && ,如下:

  "server": "export  NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",

最近更新:10/11/2024, 4:55:18 AM

原文链接:node运行报错:opensslErrorStack

|下一篇:centos7开放端口