Open jackieli123723 opened 2 years ago
fix-esm v1.0.1 Fixes ERR_REQUIRE_ESM errors so that you can require ESM modules from CommonJS
const chalk = require("fix-esm").require('chalk'); const symbols = require("fix-esm").require('log-symbols');
// let fetch = require("node-fetch") // const fetch = require('node-fetch').default not work // https://github.com/node-fetch/node-fetch const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); // cjs
应为chalk 改为了ems 导致了 chalk 不能正常使用
或者简单粗暴降级到: "chalk": "^4.0.0",
报错如下