首先使用import在ESM中导入ansi-regex(strip-ansi正在尝试导入和使用的包):
Uncaught Error: Cannot find module 'strip-ansi' at webpackMissingModule (client:6) at Object.<anonymous> (client:6) at Object../node_modules/webpack-dev-server/client/index.js?http://localhost:8080 (bundle.js:274) at __webpack_require__ (bootstrap:19) at Object.0 (bundle.js:365) ...
const ansiTrim = require('strip-ansi') // This module consumes package data in the following format: //2 changes: 2 additions & 0 deletions 2 package-lock.json Show comments View file Edit file Delete file Original file line numberDiff line numberDiff line change @@ -68,6 +68,7 @...