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

21.4k views Asked by At

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?

3

There are 3 answers

0
Chris Tarasovs On BEST ANSWER

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?

0
Sachin Gupta On

There is no command as ng init . Can you please confirm the steps you followed. Output from ng init:

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

0
Abdelhadi Abdo On

Before running npm install please do the following:

$ npm cache clean --force
$ npm install -g npm

then

$ npm install