【发布时间】:2022-11-13 03:21:19
【问题描述】:
我尝试在 node.js 中使用 axios 和 common.js
包括错误无法读取未定义的属性(读取“获取”)
- Axios 1.1.3
- Node.js 16.15.0
const axios = require("axios").default; async function test(){ const data =await axios.get("https://www.google.com") return data } test().then((res) => console.log(res.data))我试试这个
const axios = require("axios").default; async function test(){ const data =await axios.get("https://www.google.com") return data } test().then((res) => console.log(res.data)) // response => Cannot read properties of undefined (reading 'get')
【问题讨论】:
标签: javascript node.js