if someone can assist to figure out the error after tried to updated to Node v 18.14.0 and npm v. 9.3.1. Also I have updated some packages versions such us eslint to required one, react-scripts to the latest one, babel/core and babel loader.

Below is package.json

"dependencies": {
    "@azure/communication-calling": "1.9.1-beta.1",
    "@azure/communication-common": "1.0.0",
    "@azure/logger": "^1.0.2",
    "@date-io/moment": "^1.3.13",
    "@material-ui/core": "4.12.1",
    "@material-ui/icons": "^4.11.2",
    "@material-ui/lab": "^4.0.0-alpha.56",
    "@material-ui/pickers": "^3.2.10",
    "@microsoft/signalr": "6.0.10",
    "@microsoft/teams-js": "1.9.0",
    "@ungap/global-this": "^0.4.0",
    "axios": "1.3.1",
    "botframework-webchat": "4.9.1",
    "chart.js": "^3.7.0",
    "chartjs-plugin-datalabels": "^2.1.0",
    "classnames": "2.2.6",
    "core-js": "^3.6.5",
    "dompurify": "^2.2.7",
    "easy-peasy": "3.3.0",
    "eslint": "^8.33.0",
    "formik": "2.1.4",
    "html2canvas": "^1.4.1",
    "husky": "4.2.5",
    "i18next": "^19.6.2",
    "i18next-browser-languagedetector": "^5.0.0",
    "i18next-http-backend": "^1.0.21",
    "inputmask": "5.0.5",
    "insert-text-at-cursor": "0.3.0",
    "lint-staged": "10.1.7",
    "lodash": "^4.17.21",
    "lottie-react-web": "2.1.4",
    "moment": "^2.26.0",
    "nanoid": "^3.1.23",
    "prettier": "2.0.5",
    "query-string": "6.12.1",
    "react": "16.13.1",
    "react-app-polyfill": "^1.0.6",
    "react-audio-player": "^0.17.0",
    "react-calendar": "3.3.1",
    "react-chartjs-2": "^4.0.1",
    "react-datepicker": "^4.9.0",
    "react-device-detect": "^1.15.0",
    "react-dom": "16.13.1",
    "react-i18next": "^11.7.3",
    "react-idle-timer": "4.5.2",
    "react-image-crop": "^10.0.1",
    "react-images-upload": "1.2.8",
    "react-payment-inputs": "1.1.7",
    "react-phone-number-input": "3.1.17",
    "react-pose": "4.0.10",
    "react-router-dom": "5.1.2",
    "react-scripts": "5.0.1",
    "react-select": "^5.5.9",
    "react-swipeable": "^5.5.1",
    "react-table": "^7.7.0",
    "react-waypoint": "9.0.2",
    "shortid": "2.2.15",
    "source-map-explorer": "2.4.2",
    "split-string": "6.1.0",
    "styled-components": "5.1.0",
    "url-parse": "1.4.7",
    "use-debounce": "^7.0.0",
    "use-react-router": "1.0.7",
    "yup": "0.28.4"
  },
  "scripts": {
    "start": "react-scripts --max_old_space_size=16384 start",
    "build": "react-scripts --max_old_space_size=16384 build",
    "test": "react-scripts test",
    "pretty:all": "npx prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
    "analyze": "source-map-explorer 'build/static/js/*.js'",
    "tunnel": "~/ngrok http 3000 --hostname andor-chad.ngrok.io",
    "storybook": "start-storybook -p 9009 -s public",
    "build-storybook": "build-storybook -s public",
    "tw": "npx tailwindcss build ./src/tailwind-source.css -o ./src/tailwind.css"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
      "prettier --write",
      "git add"
    ]
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not op_mini all"
  ],
  "devDependencies": {
    "@babel/core": "7.20.12",
    "@storybook/addon-actions": "5.3.18",
    "@storybook/addon-knobs": "5.3.18",
    "@storybook/addon-links": "5.3.18",
    "@storybook/addons": "5.3.18",
    "@storybook/preset-create-react-app": "3.1.2",
    "@storybook/react": "6.5.16",
    "babel-loader": "9.1.2",
    "eslint-config-prettier": "^8.6.0",
    "eslint-plugin-prettier": "4.2.1",
    "npm-run-all": "4.1.5",
    "tailwindcss": "1.9.0",
    "tailwindcss-theming": "2.4.3"
  }
}

Below is the error log after npm i. I think, it is a conflict with webpack version and babel/core.

npm ERR! code 1
npm ERR! path C:\Users\OleksandrDashevskyi\WebstormProjects\AndorHealth.ThinkAndor.ClientUiReact\node_modules\markdown-it-attrs-es5
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npx -p webpack-cli@3.3.11 -p webpack@4.43.0 webpack-cli --config webpack-lib.config.js
npm ERR! C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\webpack-cli\bin\cli.js:93
npm ERR!                                throw err;
npm ERR!                                ^
npm ERR!
npm ERR! Error: Cannot find module 'ret'
npm ERR! Require stack:
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\safe-regex\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\to-regex\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\braces\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\micromatch\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\findup-sync\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\webpack-cli\bin\utils\convert-argv.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\webpack-cli\bin\cli.js
npm ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:1047:15)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:893:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR!     at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR!     at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\safe-regex\index.js:1:75)
npm ERR!     at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:930:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR!     at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR!     at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\to-regex\index.js:3:12)
npm ERR!     at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:930:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR!     at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR!     at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\braces\index.js:7:15)
npm ERR!     at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:930:12)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR!     at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR!     at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\micromatch\index.js:8:14)
npm ERR!     at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:930:12) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\safe-regex\\index.js',
npm ERR!     'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\to-regex\\index.js',
npm ERR!     'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\braces\\index.js',
npm ERR!     'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\micromatch\\index.js',
npm ERR!     'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\findup-sync\\index.js',
npm ERR!     'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
npm ERR!     'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\webpack-cli\\bin\\cli.js'
npm ERR!   ]
npm ERR! }
npm ERR!
npm ERR! Node.js v18.14.0

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_logs\2023-02-03T20_06_06_443Z-debug-0.log

Process finished with exit code 1

什么库正在使用 webpack cli?因为我在 json 包中没有看到它。