Could not find plugin "proposal-numeric-separator"

Walter picture Walter · Mar 20, 2020 · Viewed 38.3k times · Source

How to fix Could not find plugin "proposal-numeric-separator", I get this error when I try to build my React application, I have not ejected the application yet:

./src/index.js
Error: [BABEL] /home/pc/Downloads/project/src/index.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/home/pc/Downloads/project/node_modules/babel-preset-react-app/index.js$0")
    at Array.map (<anonymous>)
    at Generator.next (<anonymous>)
    at Generator.next (<anonymous>)


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have tried to download Babel and the dependency Proposal Numeric Separator, remove the Node Modules, clean the Yarn cache; but nothing worked.

I'm using Yarn 1.22.4 and Node 13.11.0, but I have also tried with NPM 6.13.7.

Answer

Hillkim Henry picture Hillkim Henry · Mar 20, 2020

The following steps work:

  1. Add the following line to package.json:
"resolutions": { 
  "@babel/preset-env": "7.5.5" 
},
  1. Run the following command:
$ npx npm-force-resolutions
  1. Install dependencies:
$ npm install
# or 
$ yarn
  1. Build your project:
$ yarn build

Take a look at this Github Issue