1

我已经用 C# 编写了产品,并且正在尝试在 Angular 应用程序中使用。我已经安装了节点模块'no-kafka'

当在 ts 组件中导入节点模块时

import * as kafka from "no-kafka";

我收到如下编译错误

Date: 2020-05-10T18:28:11.220Z - Hash: aa2be9198244ecb08ebc
4 unchanged chunks
chunk {main} main.js, main.js.map (main) 474 kB [initial] [rendered]
Time: 967ms

WARNING in ./node_modules/no-kafka/lib/protocol/misc/compression.js 5:8-35
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/no-kafka/lib/protocol/misc/compression.js 6:15-34
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/bluebird/js/release/util.js
Module not found: Error: Can't resolve 'async_hooks' in 'E:\RAVI\Electron\angular-electron\node_modules\bluebird\js\rele
ase'

ERROR in ./node_modules/bluebird/js/release/promise.js
Module not found: Error: Can't resolve 'async_hooks' in 'E:\RAVI\Electron\angular-electron\node_modules\bluebird\js\rele
ase'
ERROR in ./node_modules/hashring/index.js
Module not found: Error: Can't resolve 'crypto' in 'E:\RAVI\Electron\angular-electron\node_modules\hashring'
ERROR in ./node_modules/nice-simple-logger/index.js
Module not found: Error: Can't resolve 'dgram' in 'E:\RAVI\Electron\angular-electron\node_modules\nice-simple-logger'
ERROR in ./node_modules/no-kafka/lib/client.js
Module not found: Error: Can't resolve 'fs' in 'E:\RAVI\Electron\angular-electron\node_modules\no-kafka\lib'
ERROR in ./node_modules/no-kafka/lib/connection.js
Module not found: Error: Can't resolve 'net' in 'E:\RAVI\Electron\angular-electron\node_modules\no-kafka\lib'
ERROR in ./node_modules/nice-simple-logger/index.js
Module not found: Error: Can't resolve 'os' in 'E:\RAVI\Electron\angular-electron\node_modules\nice-simple-logger'
ERROR in ./node_modules/no-kafka/lib/connection.js
Module not found: Error: Can't resolve 'tls' in 'E:\RAVI\Electron\angular-electron\node_modules\no-kafka\lib'
ERROR in ./node_modules/nice-simple-logger/index.js
Module not found: Error: Can't resolve 'tty' in 'E:\RAVI\Electron\angular-electron\node_modules\nice-simple-logger'
ERROR in ./node_modules/no-kafka/lib/protocol/misc/compression.js
Module not found: Error: Can't resolve 'zlib' in 'E:\RAVI\Electron\angular-electron\node_modules\no-kafka\lib\protocol\m
isc'
4

0 回答 0