我的机器上的打字稿回购构建失败,但在ubuntu docker中通过

时间:2018-07-10 03:06:37

标签: node.js typescript npm

我有一个打字稿存储库,无法在我的机器上构建,并显示以下错误...

$ tsc --pretty -p tsconfig.json
../../../../../../node_modules/@types/graphql/subscription/subscribe.d.ts:17:12 - error TS2304: Cannot find name 'AsyncIterator'.

17 ): Promise<AsyncIterator<ExecutionResult> | ExecutionResult>;
              ~~~~~~~~~~~~~


../../../../../../node_modules/@types/graphql/subscription/subscribe.d.ts:29:12 - error TS2304: Cannot find name 'AsyncIterable'.

29 ): Promise<AsyncIterable<any>>;
              ~~~~~~~~~~~~~


error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

当我通过@types/graphql进行grep时,我找不到对node_modules的任何提及。我在打字稿模块中确实找到了AsyncIterator……

当我在ubuntu中的docker容器中运行构建时,它通过了,但是在我的本地OSSierra计算机上却遇到此错误。我在网上找到了一些修复程序,说可以在tsconfig.json的库中添加“ esnext”,这确实可行,但是此存储库不在我的控制范围内,我仍然没有解释为什么发生这种情况。有什么想法吗?

0 个答案:

没有答案