使用ng add ng-alain
添加模塊,遇到錯(cuò)誤進(jìn)行下一步學(xué)習(xí),完整的輸出信息:
$ ng add ng-alain
Installing packages for tooling via npm.
npm WARN ng-alain@1.4.0 requires a peer of @angular-devkit/core@^0.6.1 but none is installed. You must install peer dependencies yourself.
npm WARN ng-alain@1.4.0 requires a peer of @angular-devkit/schematics@^0.6.1 but none is installed. You must install peer dependencies yourself.
npm WARN ng-alain@1.4.0 requires a peer of @schematics/angular@^0.6.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ ng-alain@1.4.0
updated 1 package in 17.296s
Installed packages for tooling via npm.
Cannot read property 'build' of undefined
接著運(yùn)行教程中的下一行命令ng server
就會(huì)報(bào)錯(cuò):
$ ng server
The specified command ("server") is invalid. For a list of available options,
run "ng help".
Did you mean "serve"?
angular版本信息:
Angular CLI: 6.2.1
Node: 8.11.2
OS: win32 x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.8.1
@angular-devkit/build-angular 0.8.1
@angular-devkit/build-optimizer 0.8.1
@angular-devkit/build-webpack 0.8.1
@angular-devkit/core 0.8.1
@angular-devkit/schematics 0.8.1
@angular/cli 6.2.1
@ngtools/webpack 6.2.1
@schematics/angular 0.8.1
@schematics/update 0.8.1
rxjs 6.2.2
typescript 2.9.2
webpack 4.17.2
初次使用,不太懂怎么處理,還請(qǐng)同學(xué)們幫幫忙,十分感謝。
歡迎加入開(kāi)源社區(qū)!在這個(gè)社區(qū)里,就是會(huì)出現(xiàn)各種不匹配,有的時(shí)候需要等大佬們發(fā)新版來(lái)互相匹配,有的時(shí)候耐不性子,親自上場(chǎng)打怪,開(kāi)pull request
幫大佬們除妖也是一個(gè)辦法。
你這個(gè)問(wèn)題導(dǎo)致的原因是:Angular
版本太超前了,而ng-alain
版本還沒(méi)有跟上導(dǎo)致的。注意看錯(cuò)誤信息:
npm WARN ng-alain@1.4.0 requires a peer of @angular-devkit/core@^0.6.1
ng-alian
說(shuō)它需要@angular-devkit/core@^0.6.1
,而你提供的版本是:
@angular-devkit/core 0.8.1
所以目前有3
個(gè)辦法:
ng-alain
發(fā)新版支持0.8.1
。4
個(gè)小時(shí)前ng-alain
剛剛發(fā)表1.4.2版本,查看它的package.json文件,你會(huì)發(fā)現(xiàn),他們剛剛開(kāi)始支持0.8.0
。而它支持的Angular
版本僅僅只是6.1.0
,而你安裝的Angular
版本是6.1.7
,所以目前還是匹配不上?;蛘吣阋部梢园阉麄兊脑创a下載下來(lái),改造成支持Angular 6.1.7
的再上傳上去,看他們是否愿意接受。package.json
文件,把里面所有寫(xiě)著6.1.7
的地方,改成6.1.0
或者更低,然后重新npm install
。package.json
,而是重新安裝低版本的angular cli,然后重新生成項(xiàng)目:npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@6.1.0
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。