oxl9235
2018-03-06 09:21
采纳率: 100%
浏览 3.6k
已采纳

哪位前端大神帮忙看看:WebStorm开发AngularJS创建不了项目

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![图片说明](https://img-ask.csdn.net/upload/201803/06/1520327860_876753.png)图片说明

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • 周慧雨 2018-03-06 14:37
    已采纳

    应该是路径的问题 你试试这样给相对路径 应该可以的 类似这样:

    $ mkdir test
    $ ng new appName --directory "test"
    
    点赞 评论
  • bobby319 2018-03-06 10:01
    点赞 评论
  • naruto_roo 2018-03-08 07:59

    根据官方文档的操作,直接运行 【ng new appName】就好了。结果我在Mac上直接就被拒绝了,然后我就想到在指定文件夹下创建项目。
    比如你在D盘的workspace下创建angular项目,就从CMD中进入D盘 【cd D:/workspace】,然后运行【ng new appName】就好了。

     $ test
    
    点赞 评论

相关推荐 更多相似问题