我一直在与 angular cli 作斗争,因为它一直给我错误,我不在 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 serve,让我知道我不在项目中,而且我是 100%。 在执行 angular cli 项目时,我的机器上是否有我通常需要更新的配置?
最佳答案
我找到了一种设置方法,不确定这是否是您的做法以及问题所在,但它确实有效。这些日子之一:
所以你照常做:
git clone https://github.com/codediodeio/ngrx-fire.git ngrxFire
cd ngrxFire
但比不上你
rm -rf node_modules dist tmp
npm install --save-dev angular-cli@latest
npm install
npm init
在 ng init 上说不不要覆盖任何东西,下一个它会尖叫的问题是带有 promise 和 polyfill 的东西,所以你需要运行一个命令:
npm install promise-polyfill --save-exact
您会注意到它在应用程序的根目录中创建了一个 enviorments 文件夹,因此在 module.ts 中将其重新指向正确的文件夹。
你需要在 firebase 中做两件事: 1)更改身份验证中的设置,以便匿名用户可以连接并将数据库中的规则更改为
{
"rules": {
".read": true,
".write": true
}
}
你可以运行 ng-serve。现在为什么这个工作,如果有人能解释我会买那个角色喝一杯。为什么angular-cli会这样冲突?
关于angular-cli - git clone Angular Cli项目显示你不在项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46027379/