yarn start gives "digital envelope routines::unsupported" error
andybak opened this issue · 2 comments
andybak commented
Describe the bug
Clean checkout on Windows. yarn install is fine. yarn build says:
node:internal/crypto/hash:68
this[kHandle] = new _Hash(algorithm, xofLen);
Error: error:0308010C:digital envelope routines::unsupported
To Reproduce
Steps to reproduce the behavior:
- git clone
- yarn install
- yarn start
- See error
Expected behavior
No error ;-)
Desktop (please complete the following information):
- OS: Windows 11
- Browser n/a
- Version n/a
- node v20.9.0
- yarn 1.22.22
Additional context
yarn was a fresh install as well: npm install --global yarn
andybak commented
Full trace:
PS C:\Users\andyb\Documents\Spoke> yarn start
yarn run v1.22.22
$ cross-env NODE_ENV=development webpack-dev-server --mode development
i 「wds」: Project is running at https://hubs.local:9090/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\andyb\Documents\Spoke
i 「wds」: 404s will fallback to /index.html
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:68:19)
at Object.createHash (node:crypto:138:10)
at module.exports (C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:412:16)
at handleParseError (C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:463:10)
at C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:495:5
at C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:354:12
at C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
at C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:236:3
at runSyncOrAsync (C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
at iterateNormalLoaders (C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array.<anonymous> (C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (C:\Users\andyb\Documents\Spoke\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:43:16)
at C:\Users\andyb\Documents\Spoke\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:79:9
node:internal/crypto/hash:68
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:68:19)
at Object.createHash (node:crypto:138:10)
at module.exports (C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:412:16)
at handleParseError (C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:463:10)
at C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:495:5
at C:\Users\andyb\Documents\Spoke\node_modules\webpack\lib\NormalModule.js:354:12
at C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at Array.<anonymous> (C:\Users\andyb\Documents\Spoke\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (C:\Users\andyb\Documents\Spoke\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:43:16)
at C:\Users\andyb\Documents\Spoke\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:79:9
at C:\Users\andyb\Documents\Spoke\node_modules\graceful-fs\graceful-fs.js:90:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v20.9.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
andybak commented
Workaround. In package.json change the "start" command to:
"start": "set NODE_OPTIONS=--openssl-legacy-provider && cross-env NODE_ENV=development webpack-dev-server --mode development",
i.e. prefix the existing command with "set NODE_OPTIONS=--openssl-legacy-provider && "