(41條消息) npm run dev 報(bào)錯(cuò):Error: error:0308010C:digital envelope routines::unsupported_愛(ài)的嘆息的博客-CSDN博客
?npm版本要和node版本對(duì)應(yīng)(上文博主講解很詳細(xì)),所以要降低npm版本。但是我降低了以后還是報(bào)這個(gè)錯(cuò)。
error:0308010C:digital envelope routines::unsupported
出現(xiàn)這個(gè)錯(cuò)誤是因?yàn)?node.js V17版本中最近發(fā)布的OpenSSL3.0, 而OpenSSL3.0對(duì)允許算法和密鑰大小增加了嚴(yán)格的限制,可能會(huì)對(duì)生態(tài)系統(tǒng)造成一些影響.
在node.js V17以前一些可以正常運(yùn)行的的應(yīng)用程序,但是在 V17 版本可能會(huì)拋出以下異常:
目前可以通過(guò)運(yùn)行以下命令行臨時(shí)解決這個(gè)問(wèn)題
set?NODE_OPTIONS=--openssl-legacy-provider
然后我的可以打開(kāi)網(wǎng)頁(yè)了。但是下一次npm start還是會(huì)出現(xiàn)這樣的問(wèn)題;
所以尋找其他解決方法:
如何處理 Node 報(bào)錯(cuò) Error: error:0308010c:digital envelope routines::unsupported (freecodecamp.org)
- 打開(kāi)終端,運(yùn)行?
npm uninstall react-scripts
- 運(yùn)行?
npm install react-scripts
然后出現(xiàn)了新錯(cuò)誤如下:
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"babel-jest": "^26.6.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-jest was detected higher up in the tree:
C:\Users\luojiu\node_modules\babel-jest (version: 27.5.1)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if C:\Users\luojiu\node_modules\babel-jest is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls babel-jest in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed babel-jest.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
然后按照提示可以運(yùn)行了,但是出現(xiàn)了一大堆警告。。。。。但是好歹運(yùn)行成功了……
?最后下載了nvm
然后想要降低node的版本,然后nvm有個(gè)bug,看下面第二篇。??
所以直接下載安裝了node的16.18.1版本放進(jìn)了nvm里面改名為v16.18.1,然后不報(bào)錯(cuò)了,可以順利打開(kāi)了。
?
?
(41條消息) Vue 報(bào)錯(cuò)error:0308010C:digital envelope routines::unsupported_IDrens的博客-CSDN博客?文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-614941.html
(41條消息) [已解決]nvm安裝node成功,安裝npm失敗npm不是內(nèi)部或者外部的命令 + nvm安裝步驟詳解_五花漏的博客-CSDN博客_error while creating c:\users\administrator\appdat?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-614941.html
到了這里,關(guān)于npm start報(bào)錯(cuò)Error: error:0308010C:digital envelope routines::unsupported的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!