我对angular并不陌生,最初是在工作,我创建了一些示例项目,非常有趣!!然后,我尝试克隆一个项目并运行npm install
,由于我无法运行(serve
)以前的任何项目或创建新项目。
[创建新项目时会引发以下错误:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @angular/cli@~0.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'hello-world'
npm ERR! notarget
我使用npm install -g @angular/cli@latest
安装了角钢>
检查版本ng --version
显示
Angular CLI: local (v0.0.0, branch: master) Node: 12.13.1 OS: win32 x64 Angular: ... Package Version ------------------------------------------------------ @angular-devkit/architect <error> @angular-devkit/core <error> @angular-devkit/schematics <error> @schematics/angular <error> @schematics/update <error>
我尝试了各种发现的建议
到目前为止没有任何作用
我一定错过了……,因为当我运行ng --version
时,先前的项目显示了正确的angular / cli版本>
Angular CLI: local (v0.0.0, branch: master) Node: 12.13.1 OS: win32 x64 Angular: 8.2.14 ... animations, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Package Version ----------------------------------------------------------- @angular-devkit/architect 0.803.19 @angular-devkit/build-angular 0.803.19 @angular-devkit/build-optimizer 0.803.19 @angular-devkit/build-webpack 0.803.19 @angular-devkit/core 8.3.19 @angular-devkit/schematics 8.3.19 @angular/cdk 8.2.3 @angular/cli 8.3.19 @angular/material 8.2.3 @ngtools/webpack 8.3.19 @schematics/angular 8.3.19 @schematics/update 0.803.19 rxjs 6.4.0 typescript 3.5.3 webpack 4.39.2
我对angular并不陌生,最初是在工作,我创建了一些示例项目,非常有趣!!然后,我尝试克隆一个项目并运行npm install,因为我无法运行(服务)任何...
请确保您没有安装旧的CLI软件包,运行:
npm uninstall -g angular-cli
npm uninstall -g @angular/cli
我的机器上已经安装了Node.js。这是我尝试重现的步骤: