Could not find plugin “proposal-numeric-separator”

后端 未结 18 1134
情深已故
情深已故 2020-12-08 00:04

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

相关标签:
18条回答
  • 2020-12-08 00:21

    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.

    0 讨论(0)
  • 2020-12-08 00:22

    try this , this working with me .

    npm i @babel/compat-data@7.8.0
    
    0 讨论(0)
  • 2020-12-08 00:24

    I just changed react-script version from 3.0.1 to 3.4.1

    0 讨论(0)
  • 2020-12-08 00:24

    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.

    0 讨论(0)
  • 2020-12-08 00:25

    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

    0 讨论(0)
  • 2020-12-08 00:25

    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

    1. Install plugin-proposal-numeric-separator using the following code in terminal.

      npm install --save @babel/plugin-proposal-numeric-separator
      
    2. Once it is done navigate to the file as shown below.

      node_modules > @babel > preset-env > available-plugins.js

    3. In available-plugins.js below exports.default = void 0; copy and paste the following code.

      var _pluginProposalNumericSeparator = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator"));
      
    4. In available-plugins.js within var _default object declaration copy and paste the following code.

      "proposal-numeric-separator": _pluginProposalNumericSeparator.default,
      

    And it is done.

    0 讨论(0)
提交回复
热议问题