今天在使用若依的时候出现了一个bug:
INFO Starting development server... 10% building 0/1 modules 1 active ...-node D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\webpack\hot\dev-server.js ./10% building 2/5 modules 3 active ...node_modules\eslint-loader\index.js??ref--13-0!D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\src\main.jsError: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:130:10) at module.exports (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\webpack\lib\util\createHash.js:169:42) at NormalModule._initBuildHash (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:471:10) at D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:503:5 at D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\webpack\lib\NormalModule.js:358:12 at D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at iterateNormalLoaders (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:221:10) at D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:236:3 at runSyncOrAsync (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:130:11) at iterateNormalLoaders (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:232:2) at Array.<anonymous> (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\loader-runner\lib\LoaderRunner.js:205:4) at Storage.finished (D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16) at D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9 at D:\project\零一电科\技术资料\若依系统\RuoYi-Vue-master\RuoYi-Vue-master\ruoyi-ui\node_modules\graceful-fs\graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) node:internal/crypto/hash:67 this[kHandle] = new _Hash(algorithm, xofLen);
翻译
信息启动开发服务器... 10%构建0/1模块1活动...-节点D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ web pack \ hot \ dev-server . js。/10%正在构建2/5个模块3...node _ modules \ eslint-loader \ index . js??参考13比0!d:\项目\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ src \ main . js error:错误:0308010C:数字信封例程::不支持 在新哈希处(节点:内部/加密/哈希:67:19) 位于Object.createHash(节点:加密:130:10) 在module.exports (D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ web pack \ lib \ util \ create hash . js:169:42) 在正常模块。_initBuildHash (D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ web pack \ lib \ normal module . js:417:16) 在handleparserror(D:\ project \零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ web pack \ lib \ normal module . js:471:10) 在D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ web pack \ lib \ normal module . js:503:5 在D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ web pack \ lib \ normal module . js:358:12 在D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ loader-runner \ lib \ loader runner . js:373:3 在iterate normal loaders(D:\ project \零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ loader-runner \ lib \ loader runner . js:214:10) 在iterate normal loaders(D:\ project \零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ loader-runner \ lib \ loader runner . js:221:10) 在D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ loader-runner \ lib \ loader runner . js:236:3 在runSyncOrAsync (D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ loader-runner \ lib \ loader runner . js:130:11) 在iterate normal loaders(D:\ project \零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ loader-runner \ lib \ loader runner . js:232:2) 在阵列上。<匿名>(D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ loader-runner \ lib \ loader runner . js:205:4) 存储时。完成(D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ enhanced-resolve \ lib \ cachedinputfile system . js:55:16) 在D:\project\零一电科\技术资料\若依系统\ RuoYi-Vue-master \ RuoYi-Vue-master \ RuoYi-ui \ node _ modules \ enhanced-resolve \ lib \ cachedinputfile system . js:91:9 在D:\project\零一电科\技术资料\若依系统\若伊-Vue-master \若伊-Vue-master \若伊-ui \ node _ modules \ graceful-fs \ graceful-fs . js:123:16 at fsreqcallback . readfilafterclose[as on complete](节点:internal/fs/read _ file _ context:68:3) 节点:内部/加密/哈希:67 this[kHandle] = new _Hash(算法,xof len);
如何解决,这里自己用的是node17.0.0版本导致的错误
安装所对应的版本
nvm install 版本号 // 例如:nvm install 20.0.0
切换版本
nvm use 20.0.0
好了,之后修改script里的内容:
"scripts": { "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src" },