cli命令ng new不适用于angular 7 [英] cli command ng new not working for angular 7

查看:127
本文介绍了cli命令ng new不适用于angular 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需将我的cli,npm,ng和nodejs更新到最新版本. ng v为此:

Just updated my cli, npm, ng and nodejs to latest versions. An ng v gives this:

Angular CLI: 7.0.2
Node: 8.12.0
OS: darwin x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.10.2
@angular-devkit/core         7.0.2
@angular-devkit/schematics   7.0.2
@schematics/angular          7.0.2
@schematics/update           0.10.2
rxjs                         6.3.3
typescript                   3.1.3

也成功更新了旧的Angular 6项目.但是,发出命令ng new myproj后,我得到了结果:

Update old Angular 6 projects successfully also. However, upon issuing the command ng new myproj, I get the result:

Schematic input does not validate against the Schema: {"name":"myproj"}
Errors:

  Data path "" should have required property 'version'.

这个问题是如此新鲜,没有在线解决方法.有帮助吗?

The issue is so fresh there isn't how-to-fix online. Any help?

推荐答案

我也遇到过类似的问题.我严格尝试了以下步骤:

I have had similar sort of issue.I tried the following steps strictly:

->卸载角度cli(npm卸载-g @ angular/cli)

->Uninstall angular cli(npm uninstall -g @angular/cli)

->从控制面板中卸载node.js/添加或删除计算机的软件选项

->Uninstall node.js from control panel/add or remove software option of your computer

->从计算机手动删除npm和npm-cache文件夹(在您的情况下,这些文件夹位于C:\ Users \ asus \ AppData \ Roaming中 用户"可能是您的名字,华硕"可能是您的计算机制造商的名字)

->Delete npm and npm-cache folder manually from computer(These folders are in C:\Users\asus\AppData\Roaming,in your case 'Users' maybe your name and 'asus' maybe your computer manufacturers name)

->重新安装最新的node.js版本(安装时选择"npm as package manager"选项)

->Re-install latest node.js version(select the option "npm as package manager" wile installing)

->在powershell/gitbash上运行命令"npm i -g npm @ latest"

->Run the command "npm i -g npm@latest" at powershell/gitbash

->重新启动计算机

->运行"npm install -g @ angular/cli"命令

->Run "npm install -g @angular/cli" command

->运行"ng config -g cli.packageManager npm"命令

->Run "ng config -g cli.packageManager npm" command

->运行"npm缓存验证"命令(或如果节点版本< 5是npm缓存清理--force)

->Run "npm cache verify" command(or npm cache clean --force if node version < 5)

一切正常.

这篇关于cli命令ng new不适用于angular 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆