【发布时间】:2021-11-18 15:23:45
【问题描述】:
直到今天下午我都在运行以下代码,没有任何问题,我没有更改或更新任何内容,不确定是什么原因造成的:
async function getStocks(){
const { data } = await axios.get('https://gist.githubusercontent.com/graffixnyc/8c363d85e61863ac044097c0d199dbcc/raw/7d79752a9342ac97e4953bce23db0388a39642bf/stocks.json')
return data // this will be the array of people objects
}
async function abc(){
let a = await getStocks()
console.log(a)
}
abc()
它曾经从 JSON 文件中渲染整个数据,但现在抛出以下错误:
(node:1860) UnhandledPromiseRejectionWarning: Error: write EPROTO 14520:error:1408F10B:SSL `
routines:ssl3_get_record:wrong version
number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:`
我不确定哪个依赖项的版本错误,因为我没有更新代码也没有进行任何更改。
【问题讨论】:
标签: javascript json object async-await axios