meltdeer / blog

1 stars 0 forks source link

Build failed: opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ] #1

Closed meltdeer closed 1 year ago

meltdeer commented 1 year ago

runing on WSL2, and build log as below:

ron@Ron:~/workspace/blog$ pnpm run docs:dev

> blog@1.0.0 docs:dev /home/ron/workspace/blog
> vuepress dev docs

wait Extracting site metadata...
tip Apply theme vuepress-theme-reco ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress-reco/back-to-top (i.e. "@vuepress-reco/vuepress-plugin-back-to-top") ...
tip Apply plugin @vuepress-reco/pagation (i.e. "@vuepress-reco/vuepress-plugin-pagation") ...
tip Apply plugin @vuepress-reco/comments (i.e. "@vuepress-reco/vuepress-plugin-comments") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/medium-zoom (i.e. "@vuepress/plugin-medium-zoom") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
tip Apply plugin @vuepress/blog (i.e. "@vuepress/plugin-blog") ...
tip Apply plugin smooth-scroll (i.e. "vuepress-plugin-smooth-scroll") ...
tip Apply plugin auto-sidebar (i.e. "vuepress-plugin-auto-sidebar") ...
tip Apply plugin vuepress-plugin-anonymous-4505230f ...

● Client █████████████████████████ compiling (0%)  

ℹ 「wds」: Project is running at http://0.0.0.0:8080/
ℹ 「wds」: webpack output is served from /blog/
ℹ 「wds」: Content not from webpack is served from /home/ron/workspace/blog/docs/.vuepress/public
ℹ 「wds」: 404s will fallback to /index.html
node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (/home/ron/workspace/blog/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/ron/workspace/blog/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/ron/workspace/blog/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/ron/workspace/blog/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/ron/workspace/blog/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/ron/workspace/blog/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/ron/workspace/blog/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/home/ron/workspace/blog/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/ron/workspace/blog/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/ron/workspace/blog/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /home/ron/workspace/blog/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v19.8.1
 ELIFECYCLE  Command failed with exit code 1.
meltdeer commented 1 year ago

execte this code will fix it:

export NODE_OPTIONS="--openssl-legacy-provider"