安装npm软件包时无法解决依赖关系树错误 [英] Unable to resolve dependency tree error when installing npm packages

查看:78
本文介绍了安装npm软件包时无法解决依赖关系树错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试使用 npm i 命令安装npm软件包时,出现以下异常:

When trying to install the npm packages using npm i command I am getting the following exception:

我尝试使用以下方法重新安装node js软件包并将代理设置为关闭:

I have tried reinstalling the node js package and setting proxy to off using:

set HTTP_PROXY=
set HTTPS_PROXY=

问题仍然存在.我在做什么错了?

The issue is still there. What I am doing wrong?

更新:

当我运行以下命令时:

npm install --legacy-peer-deps

显示以下错误:

推荐答案

这与http代理无关.

This is not related to http proxy.

您有依赖冲突(不正确,并且可能是依赖),因此,请尝试使用运行命令--force -legacy-peer-deps .如果未生效,则临时解决方案使用节点的先前版本(降级节点版本),因为有时会导致此类错误.

You have dependency conflict (incorrect and potentially broken dependency) as it says, So try to to run the command with --force, or --legacy-peer-deps. If it doesn't take effect, the temporary solution is using prior versions of the node (Downgrading node version) as it causes to happen such this errors sometimes.

基于OP的更新:

如您所见,它会引发以下错误:

As you see, it fires the following error :

找不到与@ angular/http @ ^ 9.1.4匹配的版本.

No matching version found for @angular/http@^9.1.4.

看看 angular/http 页面.请注意,该不赞成使用的软件包的最新版本为 7.2.16 ,而您请求的是更高版本(例如 ^ 9.1.4 )!因此,请尝试检查项目依赖项并按照提出的错误进行操作,以解决问题.

Take a look at angular/http page. Note that the latest version for that deprecated package is 7.2.16 while you request an upper version (e.g ^9.1.4)! So, try to check the project dependencies and follow the raised errors in order to solve the problem.

这篇关于安装npm软件包时无法解决依赖关系树错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆