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

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

嘗試導(dǎo)入 npm 時(shí)出錯(cuò),進(jìn)入 create-react-app

嘗試導(dǎo)入 npm 時(shí)出錯(cuò),進(jìn)入 create-react-app

牛魔王的故事 2022-06-05 16:34:30
我正在嘗試在 create-react-app 應(yīng)用程序中導(dǎo)入 got ( https://www.npmjs.com/package/got ),而當(dāng)我只是嘗試將其導(dǎo)入一個(gè)文件時(shí),甚至沒(méi)有嘗試執(zhí)行任何代碼應(yīng)用程序無(wú)法編譯,我收到以下錯(cuò)誤:util.js:601 Uncaught TypeError: The "original" argument must be of type Function    at Object.promisify (util.js:601)    at Object.<anonymous> (get-body-size.js:7)    at Object../node_modules/got/dist/source/utils/get-body-size.js (get-body-size.js:30)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Object.<anonymous> (normalize-arguments.js:15)    at Object../node_modules/got/dist/source/normalize-arguments.js (normalize-arguments.js:441)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Object.<anonymous> (as-promise.js:8)    at Object../node_modules/got/dist/source/as-promise.js (as-promise.js:152)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Object../node_modules/got/dist/source/create.js (create.js:4)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Object../node_modules/got/dist/source/index.js (index.js:7)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Object../src/utils/ph_loader.js (ph_loader.js:1)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Module../src/components/Video.jsx (Searchbar.jsx:3)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Module../src/App.js (src sync:9)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Module../src/index.js (index.css?f3f6:45)    at __webpack_require__ (bootstrap:784)    at fn (bootstrap:150)    at Object.1 (ph_loader.js:21)    at __webpack_require__ (bootstrap:784)    at checkDeferredModules (bootstrap:45)    at Array.webpackJsonpCallback [as push] (bootstrap:32)    at main.chunk.js:1PS:我正在使用最新版本的 create-react-app 和最新版本的 got。
查看完整描述

1 回答

?
人到中年有點(diǎn)甜

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

正如 gots 官方自述頁(yè)面所說(shuō):

適用于 Node.js 的人性化且功能強(qiáng)大的 HTTP 請(qǐng)求庫(kù)

所以它基本上只適用于服務(wù)器端的node js,你不能在前端使用。

相反,您可以使用像axios這樣的庫(kù),它可以在前端 react 應(yīng)用程序或后端 nodejs 應(yīng)用程序中使用


查看完整回答
反對(duì) 回復(fù) 2022-06-05
  • 1 回答
  • 0 關(guān)注
  • 244 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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