2017-03-30 12 views
0

처음으로 ng cli를 사용하고 있습니다. foo 모듈 아래에 새 모듈 ('foo')과 새 구성 요소 ('bar')를 만들려고합니다. 비록, 내가 생각하는 어떻게 NG의 CLI에서 그것을 어떻게해야 해요 작동하지 않습니다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 foo/bar 

(-m없이) 실행

ng g c bar -m foo 

시도를 실행

답변

1

, 당신은을 제공해야 이 모듈에 대한 상대 경로 :

ng g c bar -m foo/foo.module 

이 경우 bar 구성 요소는 foo.module에 의해 가져 오기/내보내기되지만 src/app 아래에 위치합니다.

EISDIR는 것을 의미한다 : 예를 here에 대한 대답으로 당신은 디렉토리 (foo는) 대신 파일 (foo는/foo.module)

을 제공하기 때문에

EASDIR 오류가 발생했습니다 작업의 대상은 실제로는 디렉토리이지만 대상의 예상 파일 유형은 디렉토리가 아닌 다른 것입니다.