2017-12-26 2 views
1

에 '@ ngtools/JSON 스키마'모듈을 찾을 수 없습니다 내가오류 : 내 맥에 맥

brew install angular-cli 

와 각도-cli를 설치하지만 난 ng g service test를 실행할 때이 오류가 얻을 :

module.js:538 
    throw err; 
    ^

Error: Cannot find module '@ngtools/json-schema' 
    at Function.Module._resolveFilename (module.js:536:15) 
    at Function.Module._load (module.js:466:25) 
    at Module.require (module.js:579:17) 
    at require (internal/module.js:11:18) 
    at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/config/config.js:6:23) 
    at Module._compile (module.js:635:30) 
    at Object.Module._extensions..js (module.js:646:10) 
    at Module.load (module.js:554:32) 
    at tryModuleLoad (module.js:497:12) 
    at Function.Module._load (module.js:489:3) 

하지만 npm을 실행하면 제대로 작동합니다.

어떻게하면 해결할 수 있습니까?

내 버전은 다음과 같습니다 노드 v8.9.3 NPM의 v5.5.1

답변

1

먼저 관리자 권한으로 명령 프롬프트를 시작하고 난 sudo는 NPM은 각 @ -g를 설치`실행할 때

npm install -g @angular/cli -g --save 
+0

실행/cli -g --save'이 오류가 발생합니다. '/ usr/local/bin/ng : ../lib/node_modules/angular-cli/bin/ng을 지우지 않음 symlink 대상은 npm/usr/local/lib/node_modules/@ angular/cli' 어떻게 해결할 수 있습니까? – Momen

+0

'/ usr/local/bin/ng'과'/ usr/local/lib/node_modules/@ angular/cli'를 수동으로 제거 했으므로 이제 작동합니다. – Momen

+0

답변이 도움이되면 @Momark – Sajeetharan