ng add @angular/fire 错误无法在非交互模式下运行登录 [英] ng add @angular/fire error Cannot run login in non-interactive mode

查看:34
本文介绍了ng add @angular/fire 错误无法在非交互模式下运行登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我跑步时:

ng add @angular/fire

我收到此错误:

$ ng add @angular/fire
Skipping installation: Package already installed
UPDATE package.json (1542 bytes)
- Installing packages (npm)...
✔ Packages installed successfully.
Cannot run login in non-interactive mode. See login:ci to generate a token for use in non-interactive environments.

我在 Windows 10 Pro Git Bash 上运行它.

I am running this on Windows 10 Pro Git Bash.

此故障导致其他错误,例如ng deploy 失败,因为 ng add @angular/fire 无法使用部署目标更新 angular.json.任何想法是什么问题?非常感谢

This failure is causing other errors, e.g. ng deploy fails because ng add @angular/fire fails to update angular.json with a deploy target. Any ideas what the problem is? many thanks

Node v14.17.1@angular/cli v11.2.14

推荐答案

好的,这是一个 Windows 问题.

OK this is a Windows issue.

代替:

ng add @angular/fire

运行:

winpty node_modules/.bin/ng.cmd add @angular/fire

如果失败,请尝试:

npx firebase login --interactive // firebase should have been installed locally when the previous command failed
winpty node_modules/.bin/ng.cmd add @angular/fire

另外,代替:

ng deploy

运行:

winpty node_modules/.bin/ng.cmd deploy

最后,您可能希望将 package.json 部署脚本更新为如下所示:

Finally, you probably want to update your package.json deploy script to look like this:

"scripts": {
  ...
  "deploy": "ng deploy",
  "deploy:win": "winpty node_modules/.bin/ng.cmd deploy"
},

优秀的操作系统用户可以使用 npm run deploy 进行部署,Windows 用户可以使用 npm run deploy:win

Decent OS users can deploy with npm run deploy and Windows users can deploy with npm run deploy:win

这篇关于ng add @angular/fire 错误无法在非交互模式下运行登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆