如何成功将Angle(从6.0.9升级到7.1.4)和材质从6.3.2升级到7.2.0(或最新版本)而没有依赖项错误?

时间:2018-12-25 18:05:40

标签: angular angular-material

我曾多次尝试升级有角度的软件包,但这每次似乎都是瓶颈。

Google进行了许多快速更改,并带来了新版本(甚至在一两天后就替换了新版本)。

有人可以正确地指导我吗?我尝试了其他文章,但升级时仍然出现这些错误。

这些是我要遵循的指南:First Second

我执行了这些ng命令来升级我的源代码。

1)。 ng update @angular/cli @angular/core

...,响应为:

    ClientApp>ng update @angular/cli @angular/core
    Updating package.json with dependency @angular/forms @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency rxjs @ "6.3.3" (was "6.2.2")...
    Updating package.json with dependency @angular/language-service @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/common @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/router @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/animations @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/compiler-cli @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/core @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/platform-browser @ "7.1.4" (was "6.0.9")...
    Updating package.json with dependency @angular/cli @ "7.1.4" (was "6.0.8")...
    Updating package.json with dependency typescript @ "3.1.6" (was "2.7.2")...
    Updating package.json with dependency @angular/compiler @ "7.1.4" (was "6.0.9")...
UPDATE package.json (2167 bytes)
npm WARN @angular/cdk@6.3.3 requires a peer of @angular/core@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/cdk@6.3.3 requires a peer of @angular/common@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/flex-layout@6.0.0-beta.16 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/flex-layout@6.0.0-beta.16 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/material@6.3.3 requires a peer of @angular/core@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/material@6.3.3 requires a peer of @angular/common@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/webpack@6.0.8 requires a peer of typescript@~2.4.0 || ~2.5.0 || ~2.6.0 || ~2.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/compiler@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/core@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/platform-browser-dynamic@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/platform-browser@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/common@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-toasta@0.1.0 requires a peer of @angular/common@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-toasta@0.1.0 requires a peer of @angular/core@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 123 packages from 82 contributors, removed 8 packages, updated 17 packages, moved 2 packages and audited 23046 packages in 76.044s
found 21 vulnerabilities (9 low, 4 moderate, 8 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Invalid rule result: Function().

-============================================= ========

第一个命令完成后,我执行了以下命令:

2)。 ng update @angular/material

...,然后在命令提示符下返回以下响应:

ClientApp>ng update @angular/material
              Package "@angular/flex-layout" has an incompatible peer dependency to "@angular/cdk" (requires "^6.0.0", would install "7.2.0").

发现不兼容的对等项依赖关系。见上文。

================================================ =======================

您提到的命令之后,我已执行

1)。 npm i @ angular / flex-layout @ 7.0.0-beta.22-保存

,响应如下:

ClientApp>npm i @angular/flex-layout@7.0.0-beta.22 --save

npm WARN @ angular / cdk @ 6.3.3需要一个对等体@ angular / core @> = 6.0.0-beta.0 <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN @ angular / cdk @ 6.3.3要求对等体@ angular / common @> = 6.0.0-beta.0 <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN @ angular / material @ 6.3.3要求对等体@ angular / core @> = 6.0.0-beta.0 <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN @ angular / material @ 6.3.3要求对等体@ angular / common @> = 6.0.0-beta.0 <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN @ ngtools / webpack @ 6.0.8需要一个打字稿@@ 2.4.0的同位体|| 〜2.5.0 || 〜2.6.0 || 〜2.7.0,但未安装。您必须自己安装对等依赖项。 npm WARN codelyzer@4.2.1要求对等体@ angular / compiler @> = 2.3.1 <7.0.0 || > 6.0.0-beta <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN codelyzer@4.2.1要求对等体@ angular / core @> = 2.3.1 <7.0.0 || > 6.0.0-beta <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN codelyzer@4.2.1需要一个对等体@ angular / platform-b​​rowser-dynamic @> = 2.3.1 <7.0.0 || > 6.0.0-beta <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN codelyzer@4.2.1要求对等体@ angular / platform-b​​rowser @> = 2.3.1 <7.0.0 || > 6.0.0-beta <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN codelyzer@4.2.1要求对等体@ angular / common @> = 2.3.1 <7.0.0 || > 6.0.0-beta <7.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN ngx-toasta@0.1.0需要一个对等体@ angular / common @ ^ 6.0.0-rc.0 || ^ 6.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN ngx-toasta@0.1.0需要一个@ angular / core @ ^ 6.0.0-rc.0的对等项|| ^ 6.0.0,但未安装。您必须自己安装对等依赖项。 npm WARN @ angular / flex-layout @ 7.0.0-beta.22需要一个对等体@ angular / cdk @ ^ 7.0.0-rc.0,但没有安装。您必须自己安装对等依赖项。 npm警告可选的跳过可选依赖性:fsevents@1.2.4(node_modules \ fsevents): npm WARN notsup跳过可选依赖项:fsevents@1.2.4不受支持的平台:通缉{“ os”:“ darwin”,“ arch”:“ any”}(当前:{“ os”:“ win32”,“ arch”: “ x64”})

  • @ angular / flex-layout @ 7.0.0-beta.22 在221.832s中更新了1个程序包

================================================ ====================

在flex-layout npm软件包命令之后,

2)。 ng更新@ angular / material

,响应为:

    ClientApp>ng update @angular/material
    Updating package.json with dependency @angular/cdk @ "7.2.0" (was "6.3.3")...
    Updating package.json with dependency @angular/material @ "7.2.0" (was "6.3.3")...
UPDATE package.json (2167 bytes)
npm WARN @ngtools/webpack@6.0.8 requires a peer of typescript@~2.4.0 || ~2.5.0 || ~2.6.0 || ~2.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/compiler@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/core@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/platform-browser-dynamic@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/platform-browser@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.2.1 requires a peer of @angular/common@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-toasta@0.1.0 requires a peer of @angular/common@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-toasta@0.1.0 requires a peer of @angular/core@^6.0.0-rc.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1 package from 1 contributor, removed 1 package, updated 2 packages and audited 23046 packages in 24.069s
found 21 vulnerabilities (9 low, 4 moderate, 8 high)
  run `npm audit fix` to fix them, or `npm audit` for details

1 个答案:

答案 0 :(得分:1)

您是否为此有一个公共存储库,以便可以复制它?

尽管已进行了快速检查,但您应将@angular/flex-layout更新为7.0.0-beta.22

这可删除不兼容的警告//错误

npm i @angular/flex-layout@7.0.0-beta.22 --save

此建议基于上面的console输出和命令。似乎某些软件包保存着angular/cdk@6.x,可能是@angular/flex-layout。在运行材料更新之前,我可能会对其进行更新。