第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Nodejs 中出現(xiàn)類型錯(cuò)誤的 UnhandledPromiseRejectionWarning

Nodejs 中出現(xiàn)類型錯(cuò)誤的 UnhandledPromiseRejectionWarning

慕容708150 2023-12-14 14:08:22
當(dāng)我在nodejs中運(yùn)行node server.js時(shí),錯(cuò)誤消息顯示“無(wú)法讀取未定義的屬性‘長(zhǎng)度’”。我已經(jīng)安裝了所有相關(guān)的庫(kù)(例如請(qǐng)求)并查看了不同的相關(guān)帖子。然而,問題仍然存在。我認(rèn)為這與快遞或索引文件有關(guān)。有什么建議嗎?非常感謝!(node:14320) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefinedat 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)
查看完整描述

1 回答

?
慕蓋茨4494581

TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊

傳遞undefinedornullapp.use將導(dǎo)致顯示的錯(cuò)誤。所以我猜測(cè)您使用的環(huán)境變量有問題,例如:

app.use(process.env.ROUTING_PREFIX, routes.default);

嘗試執(zhí)行 aconsole.log(process.env.ROUTING_PREFIX)并檢查該值是否已設(shè)置或者是否為undefined.


查看完整回答
反對(duì) 回復(fù) 2023-12-14
  • 1 回答
  • 0 關(guān)注
  • 600 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)