Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular ng cli生成模块已损坏的组件_Angular_Module_Components_Angular Cli_Angular4 - Fatal编程技术网

Angular ng cli生成模块已损坏的组件

Angular ng cli生成模块已损坏的组件,angular,module,components,angular-cli,angular4,Angular,Module,Components,Angular Cli,Angular4,我第一次使用ng cli。我试图在foo模块下创建一个新模块(“foo”)和一个新组件(“bar”)。不过,我认为我应该如何在ng cli中实现这一点似乎并不可行: mbp:my-new-app chris$ ng g m foo installing module create src/app/foo/foo.module.ts mbp:my-new-app chris$ ng g c bar -m foo installing component create src/app/bar/ba

我第一次使用ng cli。我试图在foo模块下创建一个新模块(“foo”)和一个新组件(“bar”)。不过,我认为我应该如何在ng cli中实现这一点似乎并不可行:

mbp:my-new-app chris$ ng g m foo
installing module
create src/app/foo/foo.module.ts

mbp:my-new-app chris$ ng g c bar -m foo
installing component
create src/app/bar/bar.component.scss
create src/app/bar/bar.component.html
create src/app/bar/bar.component.spec.ts
create src/app/bar/bar.component.ts

EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read
at Error (native)
at Object.fs.readSync (fs.js:732:19)
at tryReadSync (fs.js:487:20)
at Object.fs.readFileSync (fs.js:535:19)
at Class.afterInstall (/Users/chris/code/my-new-app/node_modules/@angular/cli/blueprints/component/index.js:209:34)
at tryCatch (/Users/chris/code/my-new-app/node_modules/rsvp/dist/rsvp.js:539:12)
at invokeCallback (/Users/chris/code/my-new-app/node_modules/rsvp/dist/rsvp.js:554:13)
at publish (/Users/chris/code/my-new-app/node_modules/rsvp/dist/rsvp.js:522:7)
at flush (/Users/chris/code/my-new-app/node_modules/rsvp/dist/rsvp.js:2414:5)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
ng cli版本:

mbp:my-new-app chris$ ng version
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0
node: 6.10.1
os: darwin x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1
我用错了吗?我还没有找到专门关于此功能的文档

谢谢

而不是跑步

ng g c bar -m foo
尝试运行(不带-m)

如果要引用一个模块(该模块应导出/导入新组件),则应提供此模块的相对路径,如:

ng g c bar -m foo/foo.module
在这种情况下,bar组件将由foo.module导入/导出,但位于src/app下

发生EASDIR错误,因为您提供了目录(foo)而不是文件(foo/foo.module)

例如:

EISDIR意味着操作的目标实际上是一个目录,但目标的预期文件类型不是目录

而不是跑步

ng g c bar -m foo
尝试运行(不带-m)

如果要引用一个模块(该模块应导出/导入新组件),则应提供此模块的相对路径,如:

ng g c bar -m foo/foo.module
在这种情况下,bar组件将由foo.module导入/导出,但位于src/app下

发生EASDIR错误,因为您提供了目录(foo)而不是文件(foo/foo.module)

例如:

EISDIR意味着操作的目标实际上是一个目录,但目标的预期文件类型不是目录