webpack-contrib / node-loader

node loader for native modules
MIT License
119 stars 43 forks source link

error:0308010C:digital envelope routines::unsupported when running Node 18 #82

Closed Rush closed 2 years ago

Rush commented 2 years ago

It happens when running on Node 18

Module build failed (from ../node_modules/node-loader/dist/cjs.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at getHashDigest (/code/nexus/node_modules/node-loader/node_modules/loader-utils/lib/getHashDigest.js:46:34)
    at /code/nexus/node_modules/node-loader/node_modules/loader-utils/lib/interpolateName.js:113:11
    at String.replace (<anonymous>)
    at interpolateName (/code/nexus/node_modules/node-loader/node_modules/loader-utils/lib/interpolateName.js:110:8)
    at Object.loader (/code/nexus/node_modules/node-loader/dist/index.js:21:49)

Workaround:

export NODE_OPTIONS=--openssl-legacy-provider
alexander-akait commented 2 years ago

Please reinstall deps, there is a fix https://github.com/webpack/loader-utils/tree/v2.0.2 to support md4 for new Node.js versions

Rush commented 2 years ago

Thank you, solved