2016-10-13 3 views
2

저는 최근 angular2-cli를 사용하기 시작했고 새로운 프로젝트를 만들었습니다. 내 프로젝트에서 부트 스트랩을 사용하고 싶었 기 때문에 부트 스트랩을 설치하고 여기에있는 angular2-cli 가이드에 나와있는 것처럼 부트 스트랩 CSS 파일을 가져오고 싶습니다. https://github.com/angular/angular-cli#global-library-installation 서비스를 실행 한 후 다음 오류가 발생합니다.angular2-cli @multi styles error를 제공합니다

ERROR in multi styles Module not found: Error: Can't resolve '/home/krishna/angular2_migrate/webui/node_modules/bootstrap/dist/css/bootstrap.min.css' in '/home/krishna/angular2_migrate/webui/node_modules/angular-cli/models' @ multi styles

내가 뭘 잘못하고 있니? 경로 이전 angular2-CLI 버전

[email protected]:~/angular2_migrate/webui$ ng version 
Could not start watchman; falling back to NodeWatcher for file system events. 
Visit http://ember-cli.com/user-guide/#watchman for more info. 
angular-cli: 1.0.0-beta.17 
node: 4.4.3 
os: linux x64 

답변

4

추가 ../에 대한

정보. 내 경우

각-cli.json에서

,

"styles": [ 
    "../node_modules/bootstrap/dist/css/bootstrap.min.css", 
    "styles.scss" 
] 
0

오류 내가 그것을 해결

난 내 .angular-cli.json에

"styles":[ 
     "styles.css" 
    ] 

있었기 때문에이었다 수동으로 내 모든 스크립트와 CSS의 경로를 입력하여 예를 들어

angular-cli.json의 경로는 프로젝트 루트 (src/normal)에 상대적입니다. 예를 들어, src/styles.css 파일이 있지만 angular-cli.json에서는 styles.css로만 나열됩니다.

0

여기 나를위한 해결책입니다. 에서 당신이 숨겨진 파일이 "style.sass"을 "있는 style.css이를 열고 변경 .angular-cli.json 불렀다 현재 디렉토리. 실행 NG 빌드를하고 작업이 완료

전 : enter image description here 이후 : enter image description here