[英]Your global Angular CLI version (10.2.0) is greater than your local version (10.0.8). The local Angular CLI version is used
Your global Angular CLI version (10.2.0) is greater than your local version (10.0.8).您的全局 Angular CLI 版本 (10.2.0) 高于您的本地版本 (10.0.8)。 The local Angular CLI version is used.
使用本地 Angular CLI 版本。 To disable this warning use "ng config -g cli.warnings.versionMismatch false".
要禁用此警告,请使用“ng config -g cli.warnings.versionMismatch false”。
I don't know what to do with this.我不知道该怎么办。
I tried uninstalling angular/cli and npm cache clean but still have problems.我尝试卸载 angular/cli 和 npm cache clean 但仍然有问题。
It just means that you have installed the Angular CLI globally and locally (once using npm install -g
and once using just npm install
. That your project would use the locally installed version makes sense to me, since in all other cases it would presumably use the globally installed version.这只是意味着您已经在全局和本地安装了 Angular CLI(一次使用
npm install -g
一次使用npm install
。您的项目将使用本地安装的版本对我来说很有意义,因为在所有其他情况下它可能会使用全局安装的版本。
But unless specific (and unusual) requirements require it, the CLI isn't really something that will change depending on the project.但是除非特定的(和不寻常的)需求需要它,否则 CLI 并不是真的会根据项目而改变。 So I'd keep only the globally installed version and uninstall the locally installed one.
所以我只保留全局安装的版本并卸载本地安装的版本。 (I'm doubtful the
ng
command would even work if the CLI installed only locally, but I might be wrong about that.) (如果 CLI 仅在本地安装,我怀疑
ng
命令甚至可以工作,但我可能错了。)
If others work on the project and require the CLI, add an entry to your Readme instructing them to install the Angular CLI globally.如果其他人在该项目上工作并需要 CLI,请在自述文件中添加一个条目,指示他们全局安装 Angular CLI。 If, however, you require that everyone use the same CLI version, and a local installation of the CLI does enable the
ng
command, then you can also only keep the local one and uninstall the global one.但是,如果您要求每个人都使用相同的 CLI 版本,并且本地安装的 CLI 确实启用了
ng
命令,那么您也可以只保留本地的并卸载全局的。 Either way, you won't need both.无论哪种方式,您都不需要两者。 It just depends on your specific circumstances which way to go.
这只是取决于你的具体情况,走哪条路。
Many people avoid to install npm globally.许多人避免全局安装 npm。 You can uninstall angular cli from globally
您可以从全局卸载 angular cli
Then you can ng command dont work, But dont panic.然后你可以 ng 命令不起作用,但不要惊慌。
You can do the same thing by:你可以通过以下方式做同样的事情:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.