角度 6 项目,不断疯狂和 trhow 不兼容错误



我刚开始学习角度6 我下载了这个项目(使用Firebase的登录系统(,我只是想学习如何从该代码中自己实现它。 我在谷歌的帮助下修复了一些错误,但现在每次我尝试使用任何 npm 安装日期或任何给我带来此错误的东西

@angular/core@4.4.7 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler-cli@6.1.7 requires a peer of @angular/compiler@6.1.7 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@6.1.7 requires a peer of @angular/compiler@6.1.7 but none is installed. You must install peer dependencies yourself.
npm WARN angular-material@1.1.10 requires a peer of angular-animate@1.4 - 1.7.0 || ^1.7.2 but none is installed. You must install peer dependencies yourself.
npm WARN angular-material@1.1.10 requires a peer of angular-aria@1.4 - 1.7.0 || ^1.7.2 but none is installed. You must install peer dependencies yourself.
npm WARN angular-material@1.1.10 requires a peer of angular-messages@1.4 - 1.7.0 || ^1.7.2 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/animations@4.4.7 requires a peer of @angular/core@4.4.7 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/common@4.4.7 requires a peer of @angular/core@4.4.7 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/compiler@4.4.7 requires a peer of @angular/core@4.4.7 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser@4.4.7 requires a peer of @angular/core@4.4.7 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@4.4.7 requires a peer of @angular/core@4.4.7 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@4.4.7 requires a peer of @angular/core@4.4.7 but none is installed. You must install peer dependencies yourself

谁能告诉我这个错误意味着什么以及如何修复它们? 这是我在Web开发的第一天(我知道HTML JavaScript和CSS(,但是Angular 6对我来说有点困难

我尝试使用指南来升级 Angular 版本,但仍然显示相同的错误

它们是警告,而不是错误。 无论如何,你可以试试这个

ng update

rm -rf node_modules

npm install

它将升级所有角度模块,然后在重新安装所有模块之前删除现有模块。

无论如何,我个人建议您从CLI创建一个具有最新依赖项的新项目:

npm i -g @angular/cli@latest

ng new myProject

然后粘贴要在新项目中运行的代码。

在上一版本的过程中,Angular 的配置发生了很大变化,您的项目是 4.x 版本,而 Angular 现在在 6.x 范围内。

当开发人员将他们的代码推送到 github 时,他们使用的是 .gitignore 文件。此文件配置哪些文件和文件夹不会推送到存储库。因此,您必须首先运行npm install,此代码将安装项目中使用的依赖项。它们在 package.json 文件中定义。

运行npm install后,您可以使用npm startng serve -o

最新更新