当我在nodejs中运行node server.js时,错误消息显示“无法读取未定义的属性‘长度’”。我已经安装了所有相关的库(例如请求)并查看了不同的相关帖子。然而,问题仍然存在。我认为这与快递或索引文件有关。有什么建议吗?非常感谢!
(node:14320) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at pathtoRegexp (/home/floyd/Desktop/icigai/marketplace_backend/node_modules/path-to-regexp/index.js:63:49)
at new Layer (/home/floyd/Desktop/icigai/marketplace_backend/node_modules/express/lib/router/layer.js:45:17)
at Function.use (/home/floyd/Desktop/icigai/marketplace_backend/node_modules/express/lib/router/index.js:464:17)
at Function.<anonymous> (/home/floyd/Desktop/icigai/marketplace_backend/node_modules/express/lib/application.js:220:21)
at Array.forEach (<anonymous>)
at Function.use (/home/floyd/Desktop/icigai/marketplace_backend/node_modules/express/lib/application.js:217:7)
at _default (/home/floyd/Desktop/icigai/marketplace_backend/src/loaders/express.js:28:9)
at _callee$ (/home/floyd/Desktop/icigai/marketplace_backend/src/loaders/index.js:8:11)
at tryCatch (/home/floyd/Desktop/icigai/marketplace_backend/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/home/floyd/Desktop/icigai/marketplace_backend/node_modules/regenerator-runtime/runtime.js:293:22)
(node:14320) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
慕盖茨4494581
相关分类