尝试在 Next.js 项目中运行 eslint 时出现错误
There was a problem loading formatter: /Users/naya/Desktop/work/ftl/ftl-web-fe/node_modules/eslint/lib/cli-engine/formatters/stylish
Error: require() of ES Module /Users/naya/Desktop/work/ftl/ftl-web-fe/node_modules/strip-ansi/index.js from /Users/naya/Desktop/work/ftl/ftl-web-fe/node_modules/eslint/lib/cli-engine/formatters/stylish.js not supported.
Instead change the require of index.js in /Users/naya/Desktop/work/ftl/ftl-web-fe/node_modules/eslint/lib/cli-engine/formatters/stylish.js to a dynamic import() which is available in all CommonJS modules.
需要补充的是,该错误仅在我更新依赖项后才发生。 我一生中第一次看到它,我真的不认为在节点模块中更改该文件是一个好主意。有人可以帮助我吗?
已修复