Git clone Angular Cli project show that you are not in the project

Chris Tarasovs picture Chris Tarasovs · Sep 3, 2017 · Viewed 16.1k times · Source

I've been always struggling with angular cli as it keeps giving me the error that I am not in angular cli project .

Would like to setup this project https://github.com/codediodeio/ngrx-fire.

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

and than ng serve, show me that I am not in the project and I am 100%. Is there a configuration on my machine I normally need to update when i am doing a angular cli project?

Answer

Chris Tarasovs picture Chris Tarasovs · Sep 3, 2017

I found a way to set it up, not sure if this is how you do it and what is the issue but it worked. One of these days:

So you do the usual:

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

cd ngrxFire

but than you

rm -rf node_modules dist tmp
npm install --save-dev angular-cli@latest
npm install
npm init

On ng init say no to NOT overwrite anything, the next issue it will scream is that something with promise and polyfill so you need to run a command:

npm install promise-polyfill --save-exact

You will notice that it create an enviorments folder in the root of the app, so in the module.ts re-point it to the right folder.

Than you will need to in firebase do two things: 1) Change the setting in Authentication so that Anonymous user can connect and change the rules in the db to

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

Than you can run ng-serve. Now why this work , if anyone could explain I would buy that persona a drink. Why does angular-cli conflict like this?