无法编译 jhipster 示例应用程序 nodejs 应用程序
Cannot compile jhipster sample app nodejs app
我已经从 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...
有人可以帮我解决这个错误吗?
提前致谢。
这个问题是 reported in the NodeJS blueprint and fixed in this pull request。包含修复程序的新版本蓝图尚未发布。示例应用程序使用最新版本,因此它包含此问题。
修复方法是按照 related Github issue 中所述更新 server/package.json
文件:
"devDependencies": {
"@types/express-serve-static-core": "4.17.3",
我已经从 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...
有人可以帮我解决这个错误吗?
提前致谢。
这个问题是 reported in the NodeJS blueprint and fixed in this pull request。包含修复程序的新版本蓝图尚未发布。示例应用程序使用最新版本,因此它包含此问题。
修复方法是按照 related Github issue 中所述更新 server/package.json
文件:
"devDependencies": {
"@types/express-serve-static-core": "4.17.3",