已解决:opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ],

Article directory

Problem Description

  1. My node version is 17.9.1. When running an old project, the following error is reported:
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

solution

  1. After investigation: the cause of the problem is because the openssl in the node 17 version is different from the 14 version (the old project could have run under the node14 version)

  2. Solution, find the package.json file, add: set NODE_OPTIONS=--openssl-legacy-provider &&as follows:

    "dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    
  3. In the linux environment, add: export NODE_OPTIONS=--openssl-legacy-provider &&, as follows:

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

Guess you like

Origin blog.csdn.net/qq_43408367/article/details/130320382