我一直遵循设置应用程序https://github.com/IBM/cognitive-social-crm的说明,并在Windows Subsystem for Linux的ubuntu上运行,但是此时我正尝试使用npm run start在本地运行该应用程序,我收到此错误。
/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:261
[1] return new TSError(diagnosticText, diagnosticCodes)
[1] ^
[1] [nodemon] app crashed - waiting for file changes before starting...
[1] TSError: ⨯ Unable to compile TypeScript:
[1] src/util/EnrichmentPipeline.ts(75,34): error TS2769: No overload matches this call.
[1] Overload 1 of 2, '(o: {}): string[]', gave the following error.
[1] Argument of type 'unknown' is not assignable to parameter of type '{}'.
[1] Overload 2 of 2, '(o: object): string[]', gave the following error.
[1] Argument of type 'unknown' is not assignable to parameter of type 'object'.
[1] src/util/EnrichmentPipeline.ts(75,59): error TS2769: No overload matches this call.
[1] Overload 1 of 2, '(o: {}): string[]', gave the following error.
[1] Argument of type 'unknown' is not assignable to parameter of type '{}'.
[1] Overload 2 of 2, '(o: object): string[]', gave the following error.
[1] Argument of type 'unknown' is not assignable to parameter of type 'object'.
[1]
[1] at createTSError (/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:261:12)
[1] at getOutput (/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:367:40)
[1] at Object.compile (/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:558:11)
[1] at Module.m._compile (/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:439:43)
[1] at Module._extensions..js (module.js:663:10)
[1] at Object.require.extensions.(anonymous function) [as .ts] (/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:442:12)
[1] at Module.load (module.js:565:32)
[1] at tryModuleLoad (module.js:505:12)
[1] at Function.Module._load (module.js:497:3)
[1] at Module.require (module.js:596:17)
[1] at require (internal/module.js:11:18)
[1] at Object.<anonymous> (/home/cjycathy/cognitive-social-crm/server/src/index.ts:13:1)
[1] at Module._compile (module.js:652:30)
[1] at Module.m._compile (/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:439:23)
[1] at Module._extensions..js (module.js:663:10)
[1] at Object.require.extensions.(anonymous function) [as .ts] (/home/cjycathy/cognitive-social-crm/server/node_modules/ts-node/src/index.ts:442:12)
EnrichmentPipeline.ts的一部分:
public enrich(text: string) {
return new Promise((resolve, reject) => {
try {
const enrichmentPromises = [
this.nluEnrichment(text),
this.toneEnrichment(text),
this.conversationEnrichment(text),
];
Promise.all(enrichmentPromises).then((enrichments) => {
const response: { [index: string]: any } = {};
for (const e of enrichments) {
const ets = e as { [index: string]: any };
response[Object.keys(e)[0]] = ets[Object.keys(e)[0]]; #line 75 error occurs at here
}
resolve(response);
}).catch((err) => {
reject(err);
});
} catch (err) {
reject(err);
}
});
}
非常感谢您的帮助!