angular - 陷入角度 8 错误循环
问题描述
看来,我陷入了角度错误的无限循环。我将我的本地角度版本从 1.7.0 更新到角度 8。我的全局角度版本已经是 8。在将我的角度版本更新到 8 之后,我运行了以下命令
ng serve
我得到了错误说
"The serve command requires to be run in an Angular project, but a project definition could not be found"
谷歌搜索这个问题后,我在终端窗口中运行了这个命令
"ng update @angular/cli --migrate-only --from=1.7.0".
运行此命令后,我收到此错误消息
`"Repository is not clean. Please commit or stash any changes before updating.".`
为了修复错误,我运行了这个命令说
ng update --all --force.
我再次收到错误消息
"Repository is not clean. Please commit or stash any changes before updating"
所以我运行了这个命令
ng update -all --force --allow-dirty.
当我运行上述命令时,我收到了这条消息:
Repository is not clean. Update changes will be mixed with pre-existing changes.
Using package manager: 'npm'
Collecting installed dependencies...
Found 35 dependencies.
Package '-l' is not a dependency.
在此之后,我又做了
ng serve
我再次收到这个错误说
"The serve command requires to be run in an Angular project, but a project definition could not be found."
我愿意回到 Angular 版本 7,但不确定这是否会有所帮助。下面是我在执行 ng--version 时看到的图像
在这方面的任何帮助将不胜感激。
解决方案
有一个命令允许绕过 git 状态检查。
ng update @angular/cli --allow-dirty
该更新正在检查未提交的文件并失败,因为如果更新继续进行而没有干净的状态,可能会给自己带来一些麻烦。即将到来的日期只会检查 Angular 文件。
否则,存储或提交您的工作并再次运行更新命令。
推荐阅读
- google-apps-script - 有没有办法使用电子表格Appsscript从特定单元格中提取值并将其存储在另一个电子表格单元格(每天@midnight 12)中?
- gitlab-ce - Gitlab CE服务器错误Recofigure Centos 7
- c# - Blazor:如何为多个枚举类使用选择选项 Razor 组件?
- jhipster - 如何在与 JHipster 中的 localhost 不同的 IP 上运行/配置微服务
- c++ - sourcetrail 无法索引“size_t”和几个 C++ 标准库符号
- typescript - 如何使用 TypeScript 中的可选参数使重载的高阶函数正常工作?
- math - 加法导致 `MethodError: no method matching +(::Array{Int64, 0}, ::Int64)`
- python - 为什么我的康威人生游戏更新不正确?
- react-native - 反应本机 Loopback 4 套接字实现
- sql-server - 如何判断两个SQL表中的数据是否相同?