今天拉取VUE项目的最新代码,然后死活运行不了,网上找了各种方法都不好使,比如删除node_modules 重新npm install 无效。项目问题如下:
% 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
我自己最终的解决方法:
1、关闭IDE,从文件夹中把整个项目文件删除。
2、重新Clone一份代码
3、导入IDE 运行npm install
4、运行 export NODE_OPTIONS=–openssl-legacy-provider (这句最关键)
5、运行 npm run xxx
特此记录。