nodejs版本過(guò)高導(dǎo)致vue-cli項(xiàng)目無(wú)法正常運(yùn)行的幾種解決方案
報(bào)錯(cuò)信息:
Error: 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:\project\cylink-ui\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (D:\project\cylink-ui\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (D:\project\cylink-ui\node_modules\webpack\lib\NormalModule.js:471:10)
at D:\project\cylink-ui\node_modules\webpack\lib\NormalModule.js:503:5
at D:\project\cylink-ui\node_modules\webpack\lib\NormalModule.js:358:12
at D:\project\cylink-ui\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (D:\project\cylink-ui\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (D:\project\cylink-ui\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
at D:\project\cylink-ui\node_modules\loader-runner\lib\LoaderRunner.js:236:3
at runSyncOrAsync (D:\project\cylink-ui\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
at iterateNormalLoaders (D:\project\cylink-ui\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array.<anonymous> (D:\project\cylink-ui\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (D:\project\cylink-ui\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at D:\project\cylink-ui\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: 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:\project\cylink-ui\node_modules\webpack\lib\util\createHash.js:135:53)
at D:\project\cylink-ui\node_modules\graceful-fs\graceful-fs.js:123:16
at 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.13.0
由于nodejs版本過(guò)高,導(dǎo)致vue-cli項(xiàng)目運(yùn)行報(bào)錯(cuò)。
解決方案1:每次啟動(dòng)項(xiàng)目前,輸入配置命令:
set NODE_OPTIONS=--openssl-legacy-provider
解決方案2:修改package.json配置文件:
修改前:
修改后:
修改內(nèi)容:
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --open", "build:prod": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --report", "build:stage": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging", "preview": "set NODE_OPTIONS=--openssl-legacy-provider && node build/index.js --preview",
總結(jié)
到此這篇關(guān)于nodejs版本過(guò)高導(dǎo)致vue-cli項(xiàng)目無(wú)法正常運(yùn)行的幾種解決方案的文章就介紹到這了,更多相關(guān)nodejs版本過(guò)高vue-cli無(wú)法運(yùn)行內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
手把手教你通過(guò)nodejs快速搭建一個(gè)服務(wù)器
這篇文章主要給大家介紹了關(guān)于如何通過(guò)nodejs快速搭建一個(gè)服務(wù)器的相關(guān)資料,在node.js中創(chuàng)建一個(gè)服務(wù)器非常簡(jiǎn)單,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-10-10詳解nodejs微信公眾號(hào)開發(fā)——5.素材管理接口
這篇文章主要介紹了詳解nodejs微信公眾號(hào)開發(fā)——5.素材管理接口,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2017-04-04Node.js刷新session過(guò)期時(shí)間的實(shí)現(xiàn)方法推薦
下面小編就為大家?guī)?lái)一篇Node.js刷新session過(guò)期時(shí)間的實(shí)現(xiàn)方法推薦。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-05-05用NodeJS實(shí)現(xiàn)批量查詢地理位置的經(jīng)緯度接口
最近要實(shí)現(xiàn)一個(gè)顯示各個(gè)城市信息的功能,后臺(tái)一看包含一堆城市的excel,發(fā)現(xiàn)不僅有每個(gè)省的直轄市,還有二三線等的城市,數(shù)量還不少,一個(gè)個(gè)去查還挺浪費(fèi)時(shí)間的,那為什么不寫個(gè)腳本去實(shí)現(xiàn)批量查詢呢。2016-08-08Node.js中使用Log.io在瀏覽器中實(shí)時(shí)監(jiān)控日志(等同tail -f命令)
這篇文章主要介紹了Node.js中使用Log.io在瀏覽器中實(shí)時(shí)監(jiān)控日志,Log.io等同于tail -f命令,但更強(qiáng)大,需要的朋友可以參考下2014-09-09NodeJS服務(wù)器實(shí)現(xiàn)gzip壓縮的示例代碼
這篇文章主要介紹了NodeJS服務(wù)器實(shí)現(xiàn)gzip壓縮的示例代碼,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-10-10