【问题标题】:Project based , angular cli + firebase + travis ci configuration error基于项目,angular cli + firebase + travis ci 配置错误
【发布时间】:2018-11-26 00:27:35
【问题描述】:

我认为我的 travis.yml 文件代码有问题。 即使我更改了几次,我的 Travis Cl 项目也会一次又一次地失败。

.travis.yml

language: node_js
node_js:
  - "8.9"

branches:
  only:
    - master

before_script:
  - npm install  firebase-tools
  - npm install  @angular/cli

script:
  - ng build 

after_success:
  - firebase deploy --token $FIREBASE_TOKEN

所以我认为如果有人完成此配置可能会对我有所帮助。 谢谢,干杯。

【问题讨论】:

    标签: node.js angular firebase travis-ci


    【解决方案1】:

    你是对的@Sachin, 您的代码中有一些错误。 在你的第三行它应该是 node_js 版本 8,在 10,11 行它应该有 -g 命令。

    而且在脚本中也应该有 --product。

    所以在纠正了这些错误之后,我重写了代码。

    language: node_js
    node_js:
      - "8"
    
    branches:
      only:
        - master
    
    before_script:
      - npm install -g @angular/cli
      - npm install -g firebase-tools
    
    script:
      - ng build --prod --aot
    
    after_success:
      - firebase deploy --token $FIREBASE_TOKEN  
    

    希望此代码可以解决您的错误。 干杯。

    【讨论】:

    • Thnx @Emely,您的代码很完美,运行良好。并再次寻求指导。干杯。
    猜你喜欢
    • 2014-05-08
    • 1970-01-01
    • 2016-12-23
    • 2017-12-22
    • 2016-04-22
    • 1970-01-01
    • 2019-03-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多