Could not find plugin “proposal-numeric-separator”

后端 未结 18 1132
情深已故
情深已故 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:14

    In package.json

      "dependencies": {
        "@babel/compat-data": "7.8.0",
        "@babel/plugin-proposal-numeric-separator": "^7.8.3",
        "babel-loader": "^8.1.0",
      ....
      "resolutions": {
         "@babel/preset-env": "^7.8.7"
      }
    

    it is working for me. You can read more

    https://github.com/angular/angular-cli/issues/17262#issuecomment-603396857

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

    You can use this command, which has worked for me.

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

    This worked for me:

    • Delete package-lock.json
    • Delete node_modules
    • Run npm i
    0 讨论(0)
  • 2020-12-08 00:17

    I'm using angular & this worked for me, simply changed the version of @babel/compat-data from ^7.8.0 to just 7.8.0, the package-lock.json is having newer version which has bugs.

    Inside package.json:

      "devDependencies": {
        "@babel/compat-data": "7.8.0",
    }
    
    0 讨论(0)
  • 2020-12-08 00:17

    Add SKIP_PREFLIGHT_CHECK=true to .env file to make the build work without ejecting and follow the below steps:

    • Delete node_modules and package-lock.json
    • Add "resolutions": { "@babel/preset-env": "^7.8.7" } to package.json
    • Run npm install npm-force-resolutions --save-dev
    • Run npm install
    • Run npx npm-force-resolutions
    • Run npm install again
    • Run npm run build
    0 讨论(0)
  • 2020-12-08 00:20

    Reference: https://github.com/angular/angular-cli/issues/17262

    I found two solution

    a ) Install babel compat

    "devDependencies": {
        "@babel/compat-data": "7.8.0",
    } 
    

    b) Install plugin-proposal-numeric-separator

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

    install this version only 7.8.0

    1. Angular CLI can create this kind of issue. Go to package json and change it to

      build-angular": "0.803.17"

    please don't add ^ or ~ .

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