升级vue3原先vue2的项目出现:Error error0308010Cdigital envelope routinesunsupported的解决

问题复现:升级到vue3+vite的项目,nodejs升级到18.17.0,原先vue2的项目再次启动发现这个问题:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

本以为删除项目的node_modules、删除package-lock.json的文件重新执行还是出现这个问题。
再往前找错发现:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19

你可能感兴趣的:(Bug和配置错误的记录,npm,vue.js,webpack)