This error occurs because the code in 'E:\ssm-ssm-html\system-front\node_modules@vue\cli-shared-utils\lib\spinner.js' is trying to use the 'ora' package as a CommonJS module, but 'ora' is an ES Module. To fix this, the code in 'spinner.js' needs to change to use a dynamic import() instead of a require() for 'ora'.

To do this, replace the line:

const ora = require('ora')

with:

const oraPromise = import('ora');
const ora = oraPromise.default || oraPromise;

This will ensure 'ora' is loaded as an ES Module and resolve the error.

Vue CLI Shared Utils Error: ERR_REQUIRE_ESM - How to Fix 'ora' Module Import

原文地址: https://www.cveoy.top/t/topic/oGl7 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录