[英]Installing @angular/cli at version 9 but then reporting version 7
I am trying to update my global version of angular/cli to version 9, but after running the steps below I am still seeing version 7 installed.我正在尝试将 angular/cli 的全局版本更新到版本 9,但在运行以下步骤后,我仍然看到安装了版本 7。
Step 1步骤1
npm uninstall -g @angular/cli
Step 2第2步
npm cache clean --force
also tried也试过
npm cache verify
Step 3第 3 步
npm install -g @angular/cli@latest
It uninstalls fine as when I run ng --version
after the uninstall I do not see version of CLI installed.它卸载得很好,因为我在卸载后运行
ng --version
我没有看到安装的 CLI 版本。 Yet, running this again after step 3 I see version 7 installed.然而,在第 3 步之后再次运行它,我看到安装了版本 7。
You have updated it globally.您已在全球范围内对其进行了更新。 Have you tried removing node_modules in project folder?
您是否尝试过删除项目文件夹中的 node_modules ?
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.