[英]TSLint is throwing 'error TS2459: Module '"@azure/core-tracing"' declares 'Span' locally, but it is not exported.' and other errors
I have no idea where to start with fixing this error.我不知道从哪里开始修复这个错误。 The output doesn't really tell me a whole lot except that it sounds like something is wrong with the '@azure/ai-text-analytics' install.
output 并没有真正告诉我很多,只是听起来“@azure/ai-text-analytics”安装有问题。 I've
npm uninstall
'd it twice and reinstalled it twice.我已经
npm uninstall
两次并重新安装了两次。 It's giving the same error so I guess it isn't the install?它给出了同样的错误,所以我猜它不是安装?
The full error I get:我得到的完整错误:
node_modules/@azure/core-http/types/latest/src/createSpanLegacy.d.ts:1:10 - error TS2459: Module '"@azure/core-tracing"' declares 'Span' locally, but it is not exported.
1 import { Span } from "@azure/core-tracing";
~~~~
node_modules/@azure/core-tracing/types/core-tracing.d.ts:6:10
6 import { Span } from '@opentelemetry/api';
~~~~
'Span' is declared here.
node_modules/@azure/core-http/types/latest/src/webResource.d.ts:9:23 - error TS2305: Module '"@azure/core-tracing"' has no exported member 'Context'.
9 import { SpanOptions, Context } from "@azure/core-tracing";
~~~~~~~
Found 2 errors.
Obviously none of those files are my own code so I don't have anything else to show that I can think of.显然,这些文件都不是我自己的代码,所以我没有其他任何东西可以展示我能想到的。
I received help on GitHub support.我收到了有关 GitHub 支持的帮助。 Here's the link to the answer.
这是答案的链接。
I did more debugging and it looks like the TypeScript compiler is trying to build the d.ts files inside node_modules which is causing the build failure.
我做了更多调试,看起来 TypeScript 编译器正在尝试在 node_modules 中构建 d.ts 文件,这导致构建失败。 Looks like using the paths option in your tsconfig.json file caused this issue and when I removed it, the project built just fine with core-http@1.2.4.
看起来像使用 tsconfig.json 文件中的路径选项导致了这个问题,当我删除它时,使用 core-http@1.2.4 构建的项目很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.