這個看目錄結(jié)構(gòu)也是一個angular
的發(fā)布方式绣的,所以一樣進(jìn)入根目錄疏日,輸入
cnpm install
各種報錯盈滴,不是廢話的就是這句:
'bower' 不是內(nèi)部或外部命令涯肩,也不是可運(yùn)行的程序
起初沒細(xì)看,以為Angular CLI
沒裝好巢钓,就卸載掉重新裝病苗,卸載Angular CLI
也是一門技術(shù)活兒,參照安裝Angular-Cli以及失敗原因解決症汹。
-
npm uninstall -g angular-cli
后面的軟件包應(yīng)該要跟安裝時候追求一致硫朦,不然啥反應(yīng)都沒有就愉快地結(jié)束了。 -
npm cache clean
可能是清理緩存吧背镇,理解沒難度咬展。
清理完畢后,輸入
cnpm install -g @angular/cli
重新安裝Angular CLI
瞒斩,這真的是一個漫長的過程破婆。仍然提示bower
的問題,這下我認(rèn)真看了一下胸囱,應(yīng)該確實只是因為bower
沒有安裝祷舀,系統(tǒng)找不到這個軟件,所以執(zhí)行
cnpm install -g bower
安裝好bower
烹笔。確認(rèn)bower
安裝好以后裳扯,繼續(xù)輸入:
cnpm install
經(jīng)過一個不太長的等待,又報錯了箕宙,有用的是這句:
ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/angular/bower-angular-route.git", exit code of #128 fatal: unable to access 'https://github.com/angular/bower-angular-route.git/': error setting certificate verify locations: CAfile: C:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt CApath: none
Additional error details:
fatal: unable to access 'https://github.com/angular/bower-angular-route.git/': error setting certificate verify locations:
CAfile: C:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt
CApath: none
大概是一個Git
的問題嚎朽,搜索之后铺纽,參考搭建android studio環(huán)境遇到的坑兒柬帕,輸入:
git config --global http.sslVerify false
將Git
的ssl關(guān)了(大概是這意思吧)。經(jīng)過一個及其漫長又吃硬盤的時間與操作后結(jié)束狡门。
輸入:
ng build
報錯:
You seem to not be depending on "@angular/core". This is an error.
或者:
ng serve
依然報錯:
The "@angular/compiler-cli" package was not properly installed.
繼續(xù)解決中……