赞
踩
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
npm run electron:serve
时遇到问题:
- Bundling main process...node:internal/crypto/hash:69 this[kHandle] = new _Hash(algorithm, xofLen); ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:69:19) at Object.createHash (node:crypto:133:10) at module.exports (F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:471:10) at F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:503:5 at F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\NormalModule.js:358:12 at F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at Array.<anonymous> (F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\loader-runner\lib\LoaderRunner.js:205:4) at Storage.finished (F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16) at F:\vue\electron\electron-demo\node_modules\vue-cli-plugin-electron-builder\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9 at F:\vue\electron\electron-demo\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.17.1
参考博客:https://blog.csdn.net/zjjxxh/article/details/127173968
Vue 报错error:0308010C:digital envelope routines::unsupported
和博客不同的时,我在执行 npm run serve
时是没有问题的,但执行 npm run electron: serve
时出错。
参考博客方法1,在Windows的console中输入了:
set NODE_OPTIONS=--openssl-legacy-provider
之后执行
F:\vue\electron\electron-demo> npm run electron:serve > electron-demo@0.1.0 electron:serve > vue-cli-service electron:serve INFO Starting development server... DONE Compiled successfully in 4337ms 09:45:15 App running at: - Local: http://localhost:8081/ - Network: http://10.110.99.82:8081/ Note that the development build is not optimized. To create a production build, run npm run build. \ Bundling main process... DONE Compiled successfully in 1273ms 09:45:17 File Size Gzipped dist_electron\index.js 806.56 KiB 177.59 KiB Images and other types of assets omitted. Build at: 2023-08-29T01:45:17.491Z - Hash: 2ce3714cb60e42882f09 - Time: 1273ms INFO Launching Electron... electron: --openssl-legacy-provider is not allowed in NODE_OPTIONS
electron: --openssl-legacy-provider is not allowed in NODE_OPTIONS
参考博客:https://blog.csdn.net/zhu_liu_kun/article/details/130840151
之后又遇到了03000086的问题
卸载:控制面板
nodejsv16.20.2下载网址: https://nodejs.org/download/release/v16.20.2/
下载版本node-v16.20.2-x64.msi
运行 npm run electron:serve
成功
进入了问题循环,通过重新安装node.js解决
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。