Nie*_*sic 10 node.js typescript
我正在开发一个使用多个 Google Cloud 客户端库的 Typescript NodeJS 项目。我想对这些客户端库使用 ES6 导入,以便我可以在 VS Code 中使用 Intellisense。但是,当我使用 ES6 导入时,在尝试编译 Typescript 时会遇到以下问题:
Run Code Online (Sandbox Code Playgroud)TS1005: 'from' expected. 119 export * as protobufMinimal from 'protobufjs/minimal'; ~~ node_modules/google-gax/build/src/fallback.d.ts:119:13 - error TS1005: ';' expected. 119 export * as protobufMinimal from 'protobufjs/minimal'; ~~~~~~~~~~~~~~~ node_modules/google-gax/build/src/fallback.d.ts:119:29 - error TS1005: ';' expected. 119 export * as protobufMinimal from 'protobufjs/minimal'; ~~~~ node_modules/google-gax/build/src/fallback.d.ts:119:34 - error TS1005: ';' expected. 119 export * as protobufMinimal from 'protobufjs/minimal'; ~~~~~~~~~~~~~~~~~~~~ node_modules/google-gax/build/src/index.d.ts:47:10 - error TS1005: 'from' expected. 47 export * as protobufMinimal from 'protobufjs/minimal'; ~~ node_modules/google-gax/build/src/index.d.ts:47:13 - error TS1005: ';' expected. 47 export * as protobufMinimal from 'protobufjs/minimal'; ~~~~~~~~~~~~~~~ node_modules/google-gax/build/src/index.d.ts:47:29 - error TS1005: ';' expected. 47 export * as protobufMinimal from 'protobufjs/minimal'; ~~~~ node_modules/google-gax/build/src/index.d.ts:47:34 - error TS1005: ';' expected. 47 export * as protobufMinimal from 'protobufjs/minimal'; ~~~~~~~~~~~~~~~~~~~~ Found 8 errors. ```
tsconfig为了解决这个问题,我需要做任何更改吗?
谢谢!
如果你在你的 GCloud 构建中看到这个,在我的情况下修复是将 Typescript 从 3.7.2 更新到 4.1.3 - 根据我的理解,任何 3.9+ 版本都应该可以正常工作。
| 归档时间: |
|
| 查看次数: |
1501 次 |
| 最近记录: |