Essm-ssm-htmlsystem-frontnode_modulesvuecli-shared-utilslibspinnerjs1const ora = requireora ^Error ERR_REQUIRE_ESM require of ES Module Essm-ssm-htmlnode_modulesoraindexjs from Essm-ssm-htm
This error is occurring because the code in the file "E:\ssm-ssm-html\system-front\node_modules@vue\cli-shared-utils\lib\spinner.js" is attempting 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 be changed 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 that "ora" is loaded as an ES Module, and the error should be resolved
原文地址: https://www.cveoy.top/t/topic/hduy 著作权归作者所有。请勿转载和采集!