Start by adding the following to your package.json file

"resolutions": {
   "@babel/preset-env": "7.5.5"
},

next, you will run these two commands

npx npm-force-resolutions
npm install

now you can run your build method like ionic Cordova build, ionic build and etc.

the second way to fix this error is just running the following

npm install --save-dev @babel/plugin-proposal-numeric-separator