(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=–openssllegacyprovider

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

所以寻找其他解决方法

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

然后出现了新错误如下

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:Usersluojiunode_modulesbabel-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:Usersluojiunode_modulesbabel-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,然后不报错了,可以顺利打开了。

 

 

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

(41条消息) [已解决]nvm安装node成功,安装npm失败npm不是内部或者外部的命令 + nvm安装步骤详解_五花漏的博客-CSDN博客_error while creating c:usersadministratorappdat 

原文地址:https://blog.csdn.net/qq_46012097/article/details/128299723

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_16549.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注