所以,我在这里的假设是我的tsconfig或类似的东西有问题。
npm run compile
> engine@1.0.0 compile /Users/[...]/engine
> tsc
node_modules/@types/socket.io-redis/index.d.ts:76:45 - error TS2694: Namespace '"/Users/[...]/node_modules/socket.io/dist/index"' has no exported member 'Adapter'.
76 interface RedisAdapter extends SocketIO.Adapter {
然而,在检查socket.io/dist/index
时,适配器接口似乎确实在第835行导出,作为SocketIO
名称空间的一部分。
我以前没有在TS中使用过这两个@types包,但我的项目是一个非常标准的gts设置:
{
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
你能指出我哪里错了吗?
我通过卸载@types/socket.io-redis包修复了这个问题。