小编Ami*_*mir的帖子

“使用 Axios 编译 TypeScript 文件时出现 TS2585 和 TS2304 错误”

尝试使用 tsc index.ts 编译 TypeScript 代码时,如何解决以下错误?

node_modules/axios/index.d.ts:75:3 - error TS1165: A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.

75   [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
     ~~~~~~~~~~~~~~~~~

node_modules/axios/index.d.ts:75:4 - error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later.

75   [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
      ~~~~~~ …
Run Code Online (Sandbox Code Playgroud)

node.js typescript axios

2
推荐指数
1
解决办法
478
查看次数

标签 统计

axios ×1

node.js ×1

typescript ×1