npm start报错Error: error:0308010C:digital envelope routines::unsupported

这篇具有很好参考价值的文章主要介绍了npm start报错Error: error:0308010C:digital envelope routines::unsupported。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

(41条消息) npm run dev 报错:Error: error:0308010C:digital envelope routines::unsupported_爱的叹息的博客-CSDN博客

 npm版本要和node版本对应(上文博主讲解很详细),所以要降低npm版本。但是我降低了以后还是报这个错。

error:0308010C:digital envelope routines::unsupported
出现这个错误是因为 node.js V17版本中最近发布的OpenSSL3.0, 而OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响.

在node.js V17以前一些可以正常运行的的应用程序,但是在 V17 版本可能会抛出以下异常:

目前可以通过运行以下命令行临时解决这个问题
set NODE_OPTIONS=--openssl-legacy-provider

然后我的可以打开网页了。但是下一次npm start还是会出现这样的问题;

所以寻找其他解决方法:

如何处理 Node 报错 Error: error:0308010c:digital envelope routines::unsupported (freecodecamp.org)

  • 打开终端,运行 npm uninstall react-scripts
  • 运行 npm install react-scripts

然后出现了新错误如下:

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.

然后按照提示可以运行了,但是出现了一大堆警告。。。。。但是好歹运行成功了……

 最后下载了nvm

然后想要降低node的版本,然后nvm有个bug,看下面第二篇。  

所以直接下载安装了node的16.18.1版本放进了nvm里面改名为v16.18.1,然后不报错了,可以顺利打开了。

npm start报错Error: error:0308010C:digital envelope routines::unsupported,区块链项目实战,npm,node.js,vue.js 

 

(41条消息) Vue 报错error:0308010C:digital envelope routines::unsupported_IDrens的博客-CSDN博客 

(41条消息) [已解决]nvm安装node成功,安装npm失败npm不是内部或者外部的命令 + nvm安装步骤详解_五花漏的博客-CSDN博客_error while creating c:\users\administrator\appdat 文章来源地址https://www.toymoban.com/news/detail-614941.html

到了这里,关于npm start报错Error: error:0308010C:digital envelope routines::unsupported的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包