2017-09-03 38 views
0

我一直在使用角度cli來掙扎,因爲它一直給我錯誤,我不在角度cli項目中。Git clone Angular Cli項目顯示你不在項目中

想建立這個項目https://github.com/codediodeio/ngrx-fire

I followed the basics: 
git clone https://github.com/codediodeio/ngrx-fire.git ngrxFire 
cd ngrxFire 
npm install 

並比ng服務,告訴我,我不在項目中,我是100%。 當我正在做一個角度cli項目時,通常需要更新我機器上的配置嗎?

+0

您是否製作'的src /環境/ environment.ts'文件?順便提一下,請提供確切的錯誤。 – Pave

+0

是的,我有,我已經想通過如何得到這個運行,將發佈在第二個 –

+0

什麼是你的全球角度cli版本? – Kuncevic

回答

0

我找到了一種方法來設置它,不知道這是如何做到這一點,是什麼問題,但它的工作。這些天:

所以你做平常:

git clone https://github.com/codediodeio/ngrx-fire.git ngrxFire 

cd ngrxFire 

但比你

rm -rf node_modules dist tmp 
npm install --save-dev [email protected] 
npm install 
npm init 

在納克的init說不不覆蓋任何東西,接下來的問題,它會尖叫是那些有承諾和polyfill,所以你需要運行一個命令:

npm install promise-polyfill --save-exact 

您會注意到它在應用程序的根目錄中創建了enviorments文件夾,因此在module.ts中將它重新指向了正確的文件夾。

比你需要的火力做兩件事情: 1)更改身份驗證設置,讓匿名用戶可以連接並更改數據庫的規則

{ 
    "rules": {  
     ".read": true, 
     ".write": true 
    } 
} 

比你可以運行NG-服務。現在爲什麼這項工作,如果有人能解釋我會買這個角色一杯。爲什麼angular-cli會這樣衝突?

0

沒有命令作爲ng init。你能否確認你所遵循的步驟?從ng init 輸出:

The specified command init is invalid. For available options, see ng help.

+0

道歉我總是嘗試使用最新的npm,仍然顯示過程 –