When I run "yarn run electron:serve" on node v18.12.1, I get "error:0308010C:digital envelope routines::unsupported".
See original GitHub issueWhen I run “yarn run electron:serve” on node v18.12.1, I get “error:0308010C:digital envelope routines::unsupported”. I am using Windows and tried “–openssl-legacy-provider” but it did not work. The detailed logs are as follows:
yarn run electron:serve
yarn run v1.22.15
warning ..\..\package.json: No license field
$ vue-cli-service electron:serve --openssl-legacy-provider
INFO Starting development server...
DONE Compiled successfully in 3626ms 5:02:32
App running at:
- Local: http://localhost:8080/
- Network: http://192.168.0.x:8080/
Note that the development build is not optimized.
To create a production build, run yarn build.
- Bundling main process...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:133:10)
at module.exports (C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at Array.<anonymous> (C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at C:\Users\user\Desktop\vue-electron\node_modules\vue-cli-plugin-electron-builder\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
at C:\Users\user\Desktop\vue-electron\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 v18.12.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Issue Analytics
- State:
- Created 10 months ago
- Reactions:2
- Comments:8
Top Results From Across the Web
Error message "error:0308010C:digital envelope routines ...
This fix was a breaking change that corresponded with similar breaking changes in the SSL packages in NPM. When you attempt to use...
Read more >error:0308010c:digital envelope routines::unsupported [Node ...
If you work with Node.js and command line interface solutions like ... I'm currently getting it too: The React app indeed failed to...
Read more >Error:0308010C:digital envelope routines::unsupported #11708
I installed the latest Node version, currently, it's 17.2.0 . When I try to start the project in development mode with the command...
Read more >How to Fix the Error Error:error:0308010C:digital envelope ...
Pass the --openssl-legacy-provider flag to Webpack or the Webpack-based CLI tool. Set the NODE_OPTIONS environment variable to --openssl-legacy ...
Read more >error:0308010C:digital envelope routines::unsupported [Fixed]
The error:0308010C:digital envelope routines::unsupported occurs because Node.js v17 and later use OpenSSL v3.0 which has had breaking changes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Indeed, after several searches, I found a solution in stackoverflow ! https://stackoverflow.com/a/72219174
Just add this to the top of vue.config.js :
No it doesn’t, as it not an argument to
vue-cli-service…Either use
export NODE_OPTIONS=--openssl-legacy-providerorcross-env NODE_OPTIONS=--openssl-legacy-providerin your scripts…