首页 文章

Travis Build中的打字稿失败

提问于
浏览
3

我试图让我的项目 Build 在Travis上(所有工作在当地都很好) . 我遇到了Typescript的问题 . 在我的 .travis.yml 文件中,我有这组命令:

before_script:
  - npm i -g typescript typings
  - typings install
  - tsc

运行打字稿编译 . 但是,当我运行它时,我会遇到大量错误......

例如

client / dev / nav / nav.component.ts(4,29):错误TS2307:找不到模块'../user/services/user.service' . node_modules / angular2-jwt / node_modules / rxjs / CoreOperators.d.ts(35,67):错误TS2304:找不到名称'Promise' . node_modules / angular2-jwt / node_modules / rxjs / CoreOperators.d.ts(50,66):错误TS2304:找不到名称'Promise' . node_modules / angular2-jwt / node_modules / rxjs / CoreOperators.d.ts(89,67):错误TS2304:找不到名称'Promise' .

Here是完整的构建日志 . 和Here是完整的回购 .

据推测,打字未正确安装,打字未正确配置或任何服务器/客户端文件中没有引用主打字文件?

我真的很感激可能出错的一些指导,或者我可以在哪里调试这个?

2 回答

  • 0

    未正确配置类型

    从错误日志 Promise 未定义 . 最快的解决方法是添加 promise.d.ts ,例如:v8promise.d.ts并将其添加到您的项目中 .

  • 0

    而是使用Jasmine的承诺

    import { promise } from 'protractor'
    

相关问题