Could not find plugin “proposal-numeric-separator”

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

    Try this, it works: npm i @babel/compat-data@7.8.0

    I have just used it like 10 minutes ago, and it's working fine.

    Related issue going on github about this. Click Here!

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

    worked for me. npm install @babel/compat-data@~7.8.0

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

    I just had this happen to me. The To fix it I ran yarn build with sudo privileges.

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

    Why this problem happened?:

    It's an issue of conflicts between internal packages used by babel.

    Adding a new plugin to @babel/compat-data breaks old @babel/preset-env versions. This is because preset-env iterates over compat-data's plugins, and throws if the plugin isn't defined in preset-env's available-plugins.js file.

    This is the merge that fixed the issue: https://github.com/babel/babel/pull/11201/files/a88a00750c61ff89f1622d408d67108719f21ecd

    Solution:

    • Delete package-lock.json or yarn.lock
    • Delete node_modules folder
    • In package.jon I have adjusted the version numbers of these packages to:
        ...
        "devDependencies": {
            "@babel/compat-data": "^7.8.0",
            "@babel/preset-env": "^7.8.0",
            "babel-loader": "^8.1.0",
            ...
        },
        ...
        "resolutions": {
            "@babel/preset-env": "^7.8.0"
        }
    
    • Run npm install
    • Run npm run build
    0 讨论(0)
  • 2020-12-08 00:36

    I faced similar issue and i was able to fix it by updating all babel dependencies to latest version. I'm not aware of the exact issue with babel. However, the below mentioned step worked for me.

    Step 1: identify and remove all babel related dependencies from package.json

    npm remove @babel/runtime @babel/core @babel/plugin-proposal-class-properties @babel/plugin-transform-modules-commonjs @babel/plugin-transform-runtime @babel/preset-env @babel/preset-react babel-eslint babel-jest babel-loader
    

    Step 2: re-install babel dependencies

    npm install --save @babel/runtime
    
    npm install --save-dev @babel/core @babel/plugin-proposal-class-properties @babel/plugin-transform-modules-commonjs @babel/plugin-transform-runtime @babel/preset-env @babel/preset-react babel-eslint babel-jest babel-loader
    

    PS: The above list of babel dependencies will differ for your project.

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

    In my case I've got a corrupted node_modules folder. My yarn install simply stopped in the middle by a power surge.

    By running:

    rm -rf node_modules
    yarn
    

    My problem was solved.

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