本地服务器不会启动 TS-Error Container TS2345 NodeJS?

Local server won't start TS-Error Container TS2345 NodeJS?

我正在尝试 运行 服务器上的测试项目。 给出错误信息

~/www/ork-wiki-admin-back-test $ npm run test-start

> ork_wiki_admin_back@1.0.0 test-start /var/www/ork-wiki-admin-back-test
> tsc && yarn copy-files && NODE_ENV=testing forever start --id='ork_wiki_admin_back_test' dist/index.js

src/index.ts:22:43 - error TS2345: Argument of type 'import("/var/www/ork-wiki-admin-back-test/node_modules/inversify/dts/container/container").Container' is not assignable to parameter of type 'import("/var/www/ork-wiki-admin-back-test/node_modules/inversify-express-utils/node_modules/inversify/lib/interfaces/interfaces").interfaces.Container'.
Type 'Container' is missing the following properties from type 'Container': rebindAsync, unbindAsync, unbindAllAsync, isCurrentBound, and 9 more.

22 const server = new InversifyExpressServer(diContainer);
~~~~~~~~~~~

Found 1 error in src/index.ts:22

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! ork_wiki_admin_back@1.0.0 test-start: `tsc && yarn copy-files && NODE_ENV=testing forever start --id='ork_wiki_admin_back_test' dist/index.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the ork_wiki_admin_back@1.0.0 test-start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

我已经尝试了两天了,但无法弄清楚问题出在哪里。 如何解决这个问题?

我遇到了同样的问题,这是由于版本不匹配造成的。我将 inversify 更新为 v6.0.1 并将 inversify-express-utils 更新为 v6.3.2,错误已解决。希望这对您有所帮助!