解决方法:治标不治本,每次运行前,先输入

$env:NODE_OPTIONS="--openssl-legacy-provider"

再运行

npm run dev
yarn run v1.22.19warning package.json: "dependencies" has dependency "script-loader" with range "0.7.2" that collides with a dependency in "devDependencies" of the same name with version "^0.7.2"$ vue-cli-service serve --openINFO Starting development server...10% building 2/2 modules 0 activei 「wds」: Project is running at http://localhost:9527/i 「wds」: webpack output is served from /i 「wds」: Content not from webpack is served from D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\publici 「wds」: 404s will fallback to /index.html10% building 2/5 modules 3 active ...\node_modules\webpack\hot\dev-server.jsError: error:0308010C:digital envelope routines::unsupportedat new Hash (node:internal/crypto/hash:71:19)at Object.createHash (node:crypto:133:10)at module.exports (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\util\createHash.js:90:53)at NormalModule._initBuildHash (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:401:16)at handleParseError (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:449:10)at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:481:5at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:342:12at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:373:3at iterateNormalLoaders (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:214:10)at iterateNormalLoaders (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:221:10)at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:236:3at runSyncOrAsync (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:130:11)at iterateNormalLoaders (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:232:2)at Array. (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:205:4)at Storage.finished (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:910% building 2/6 modules 4 active ...\node_modules\webpack\hot\dev-server.jsnode:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^Error: error:0308010C:digital envelope routines::unsupportedat new Hash (node:internal/crypto/hash:71:19)at Object.createHash (node:crypto:133:10)at module.exports (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\util\createHash.js:90:53)at NormalModule._initBuildHash (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:401:16)at handleParseError (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:449:10)at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:481:5at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\@vue\cli-service\node_modules\webpack\lib\NormalModule.js:342:12at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:373:3at iterateNormalLoaders (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:214:10)at Array. (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\loader-runner\lib\LoaderRunner.js:205:4)at Storage.finished (D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9at D:\softdownload\google下载\crmeb_java-master\crmeb_java-master\admin\node_modules\graceful-fs\graceful-fs.js:123:16at 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.15.0error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.