【发布时间】:2019-10-25 03:24:04
【问题描述】:
我正在尝试使用ng update --all 更新我的 Angular,如本问题所述 [https://stackoverflow.com/questions/56419456/cant-find-compiler-ngcc-module-after-upgrading-angular-and -project],但它总是说Repository is not clean. Please commit or stash any changes before updating.
我今天运行了以下命令:
npm install
npm install -g @angular/cli
npm install --save font-awesome angular-font-awesome
npm install angular-alert-module --save
在这个状态下程序编译
ng update @angular/cli
从那以后它不再编译
我读到我需要做ng update --all --force,但它不起作用,因为存储库“不干净”。
我之前做了一个提交,将其推送并拉出(没有更改)。但这并没有帮助
ng update --all --force
错误信息是:
Repository is not clean. Please commit or stash any changes before updating.
【问题讨论】:
-
git status的输出是什么? -
在分支详细搜索您的分支是最新的'origin/detail-search'。未为提交暂存的更改:(使用“git add
...”更新将提交的内容)(使用“git checkout -- ...”放弃工作目录中的更改)修改:package- lock.json 没有添加任何更改提交(使用“git add”和/或“git commit -a”) -
对不起,我忘了包括:当我尝试编译时:找不到模块'@angular/compiler-cli/ngcc'错误:找不到模块'@angular/compiler-cli/ ngcc' 在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) 在 Function.Module._load (internal/modules/cjs/loader.js:508:25) ...
-
你需要
git add --all,然后commit。你已经修改了 package-lock.json。 -
为您的编译错误打开一个新问题,试图找出错误部分。