因?yàn)樾聯(lián)Q了電腦,重新安裝vs code和 nodejs 跑前端項(xiàng)目,npm run install之后,vs code命令行出現(xiàn)錯(cuò)誤:error: error:0308010C:digital envelope routines::unsupported
10% building 2/4 modules 2 active ...node_modules\webpack\hot\dev-server.js E
rror: 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 (D:\workstation\adautotest_workstation\adautotest_web\node_modules\webpack\lib\util\createHash.js:135:53)
? ? at NormalModule._initBuildHash (D:\workstation\adautotest_workstation\adautotest_web\node_modules\webpack\lib\NormalModule.js:417:16)
? ? at handleParseError (D:\workstation\adautotest_workstation\adautotest_web\node_modules\webpack\lib\NormalModule.js:471:10)
? ? at D:\workstation\adautotest_workstation\adautotest_web\node_modules\webpack\lib\NormalModule.js:503:5
? ? at D:\workstation\adautotest_workstation\adautotest_web\node_modules\webpack\lib\NormalModule.js:358:12
? ? at D:\workstation\adautotest_workstation\adautotest_web\node_modules\loader-runner\lib\LoaderRunner.js:373:3
? ? at iterateNormalLoaders (D:\workstation\adautotest_workstation\adautotest_web\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
? ? at iterateNormalLoaders (D:\workstation\adautotest_workstation\adautotest_web\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
? ? at D:\workstation\adautotest_workstation\adautotest_web\node_modules\loader-runner\lib\LoaderRunner.js:236:3
? ? at runSyncOrAsync (D:\workstation\adautotest_workstation\adautotest_web\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
? ? at iterateNormalLoaders (D:\workstation\adautotest_workstation\adautotest_web\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
? ? at Array.<anonymous> (D:\workstation\adautotest_workstation\adautotest_web\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
? ? at Storage.finished (D:\workstation\adautotest_workstation\adautotest_web\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
? ? at D:\workstation\adautotest_workstation\adautotest_web\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
10% building 2/5 modules 3 active ...workstation\adautotest_web\src\main.js n
ode:internal/crypto/hash:71
? this[kHandle] = new _Hash(algorithm, xofLen);
網(wǎng)上查了,可能是nodejs版本過高導(dǎo)致的錯(cuò)誤:
解決辦法:
在命令行跑下列命令:
set NODE_OPTIONS=--openssl-legacy-provider文章來源:http://www.zghlxwxcb.cn/news/detail-566647.html
再次運(yùn)行:npm run serve 成功?文章來源地址http://www.zghlxwxcb.cn/news/detail-566647.html
到了這里,關(guān)于npm run serve出現(xiàn)錯(cuò)誤 error:0308010C:digital envelope routines::unsupported的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!