F:\NODE\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng new untitled --dir=.
Error: Schematic input does not validate against the Schema: {"directory":".","name":"untitled","skipGit":false,"style":"css","version":"1.7.2","commit":{"message":"chore: initial commit from @angular/cli\n\n _ _ ____ _ \n / \ _ _ __ _ _ | | _ _ _ __ / ___| | |_ |\n / △ \ | ' \ / _\| | | | |/ _\\
| '| | | | | | |\n / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |\n/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|\n |___/\n","name":"Angular CLI","email":"angular-cli@angular.io"},"path":"app","sourceDir":"src","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","skipTests":false,"skipInstall":false,"linkCli":false,"minimal":false,"serviceWorker":false}
Errors:
.directory should match format "path"
Schematic input does not validate against the Schema: {"directory":".","name":"untitled","skipGit":false,"style":"css","version":"1.7.2","commit":{"message":"chore: initial commit from @angular/cli\n\n _ _ ____ _ \n / \ _ _ __ _ _ | | _ _ _ __ / ___| | |_ |\n / △ \ | ' \ / _\| | | | |/ _\\
| '| | | | | | |\n / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |\n/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|\n |___/\n","name":"Angular CLI","email":"angular-cli@angular.io"},"path":"app","sourceDir":"src","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","skipTests":false,"skipInstall":false,"linkCli":false,"minimal":false,"serviceWorker":false}
Errors:
.directory should match format "path"
Done
应该是路径的问题 你试试这样给相对路径 应该可以的 类似这样:
$ mkdir test
$ ng new appName --directory "test"
看看这边文章,https://www.genuitec.com/forums/topic/create-angular-project-problems/。或许对你有帮助
根据官方文档的操作,直接运行 【ng new appName】就好了。结果我在Mac上直接就被拒绝了,然后我就想到在指定文件夹下创建项目。
比如你在D盘的workspace下创建angular项目,就从CMD中进入D盘 【cd D:/workspace】,然后运行【ng new appName】就好了。
$ test