📜  不支持 ES 模块的 require(). - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:13.856000             🧑  作者: Mango

代码示例2
node-fetch v3 recently stopped support for the
require way of importing it in favor of ES Modules.

Old:
const fetch = require('node-fetch');

New:
import fetch from "node-fetch";