无法编译jhipster示例应用程序nodejs应用程序

问题描述 投票:0回答:1

我从github(link)中克隆了jhipster-sample-app-nodejs。

我已遵循所有有关编译和运行应用程序的说明

我已经安装了执行所需的所有工具(npm,nodejs,哟)

[当我尝试使用npm start运行我的应用程序时,出现此错误消息:

    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/web/rest/user.controller.ts:29:54 - error TS2345: Argument of type 'string | Query | (string | Query)[]' is not assignable to parameter of type 'string | number'.
  Type 'Query' is not assignable to type 'string | number'.
    Type 'Query' is not assignable to type 'string'.

29     const pageRequest: PageRequest = new PageRequest(req.query.page, req.query.size, req.query.sort);
                                                        ~~~~~~~~~~~~~~

    at createTSError (C:\Users\uname\Desktop\test\jhipster-sample-app-nodejs-master\server\node_modules\ts-node\src\index.ts:240:12)
    at reportTSError (C:\Users\unmae\Desktop\test\jhipster-sample-app-nodejs-master\server\node_modules\ts-node\src\index.ts:244:19)
    at getOutput (C:\Users\uname\Desktop\test\jhipster-sample-app-nodejs-master\server\node_modules\ts-node\src\index.ts:360:34)
    at Object.compile (C:\Users\uname\Desktop\test\jhipster-sample-app-nodejs-master\server\node_modules\ts-node\src\index.ts:393:11)
    at Module.m._compile (C:\Users\uname\Desktop\test\jhipster-sample-app-nodejs-master\server\node_modules\ts-node\src\index.ts:439:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Object.require.extensions.<computed> [as .ts] (C:\Users\uname\Desktop\test\jhipster-sample-app-nodejs-master\server\node_modules\ts-node\src\index.ts:442:12)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
[nodemon] app crashed - waiting for file changes before starting...

有人可以帮助我解决此错误吗?

先谢谢您。

node.js typescript jhipster nestjs
1个回答
0
投票

此问题在NodeJS蓝图中是reported,在this pull request中已解决。包含此修复程序的蓝图的新版本尚未发布。示例应用程序使用最新版本,因此包含此问题。

解决方法是按照server/package.json所述更新related Github issue文件:

"devDependencies": {
    "@types/express-serve-static-core": "4.17.3",
© www.soinside.com 2019 - 2024. All rights reserved.