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 y
From the corresponding issue in create-react-app,
Update react-scripts to 3.4.1 in your package.json file and remove node_modules as well as package-lock.json/yarn.lock and re-install.
try this , this working with me .
npm i @babel/compat-data@7.8.0
I just changed react-script version from 3.0.1 to 3.4.1
In my angular 8 application, although I did not have any direct dependancy of react-scripts package and did not have it in package.json
either but started getting this error on build. It was likely used as a depedancy by other packges.
By reading this post on github, I added it as dependancy in package.json "react-scripts": "3.4.1"
and run npm install the build started working just fine.
The following steps work:
package.json
:"resolutions": {
"@babel/preset-env": "7.5.5"
},
$ npx npm-force-resolutions
$ npm install
# or
$ yarn
$ yarn build
Take a look at this Github Issue
Its just a 4 step process.
Reason:
This happens because of a package missing in babel. This will happen even if you create angular app using ng new
command.
Solution
Install plugin-proposal-numeric-separator
using the following code in terminal.
npm install --save @babel/plugin-proposal-numeric-separator
Once it is done navigate to the file as shown below.
node_modules > @babel > preset-env > available-plugins.js
In available-plugins.js below exports.default = void 0;
copy and paste the following code.
var _pluginProposalNumericSeparator = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator"));
In available-plugins.js within var _default
object declaration copy and paste the following code.
"proposal-numeric-separator": _pluginProposalNumericSeparator.default,
And it is done.