webpack/hot/dev-server.jsError: error:0308010C:digital envelope routines::unsupported

Pulled the latest code of the VUE project today, and then it couldn’t run. I found various methods on the Internet , but it didn’t work. For example, deleting node_modules and re-npm install didn’t work. The project questions are as follows:
insert image description here

% building 2/5 modules 3 active /Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/webpack/hot/dev-server.jsError: 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 (/Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/arthur/Documents/si_huo/FM_LYTJ/fmLytj-ui/no

My own final solution:
1. Close the IDE and delete the entire project file from the folder.
2. Clone a copy of the code again
3. Import IDE and run npm install
4. Run export NODE_OPTIONS=–openssl-legacy-provider (this sentence is the most critical)
5. Run npm run xxx

It is hereby recorded.

Guess you like

Origin blog.csdn.net/chunqiuwei/article/details/131874206