Não foi possível encontrar o plug-in "separador-numérico-proposta" no aplicativo angular

11

Estou recebendo o erro abaixo ao executar ng build --prod.

An unhandled exception occurred: [BABEL] /root/catch-up-enterprise/dist/polyfills-es5.8e4ba13e1c10f0a37bb4.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js") See "/tmp/ng-sg4wHH/angular-errors.log" for further details

Log de erro:

[root@localhost ~]# more /tmp/ng-sg4wHH/angular-errors.log
[error] Error: [BABEL] /root/catch-up-enterprise/dist/polyfills-es5.8e4ba13e1c10f0a37bb4.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry 
in ./available-plugins.js for it. (While processing: "/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js")
    at getPlugin (/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js:67:11)
    at Array.from.map.pluginName (/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js:258:62)
    at Array.map (<anonymous>)
    at _default (/root/catch-up-enterprise/node_modules/@angular-devkit/build-angular/node_modules/@babel/preset-env/lib/index.js:258:43)
    at /root/catch-up-enterprise/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at /root/catch-up-enterprise/node_modules/@babel/core/lib/config/full.js:179:14
    at Generator.next (<anonymous>)
    at Function.<anonymous> (/root/catch-up-enterprise/node_modules/@babel/core/lib/gensync-utils/async.js:26:3)
    at Generator.next (<anonymous>)
    at step (/root/catch-up-enterprise/node_modules/gensync/index.js:254:32)
    at evaluateAsync (/root/catch-up-enterprise/node_modules/gensync/index.js:284:5)
    at Function.errback (/root/catch-up-enterprise/node_modules/gensync/index.js:108:7)
    at errback (/root/catch-up-enterprise/node_modules/@babel/core/lib/gensync-utils/async.js:70:18)
    at async (/root/catch-up-enterprise/node_modules/gensync/index.js:183:31)
    at onFirstPause (/root/catch-up-enterprise/node_modules/gensync/index.js:209:13)
    at Generator.next (<anonymous>)

Etapas tentadas: Eu pensei que o problema estava faltando módulo separador de proposta numérica, então instalei o módulo via comando abaixo

    npm i @babel/plugin-proposal-numeric-separator

Ainda assim, o problema não foi resolvido; portanto, tentei a resposta dada no problema semelhante , ainda ocorreu o mesmo erro.

Como consertar este problema?

Mohan
fonte

Respostas:

28

Obrigado a nicolo-ribaudo da edição8680

A adição da dependência @ babel / compat-data ":" 7.8.0 "corrigiu o problema para mim.

vi package.json

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

npm install

ng build --prod
Mohan
fonte
11
funcionou perfeitamente para mim
Ahsan Alii 23/03
Não se esqueça de executar npm idepois de adicionar a dependência.
Stack Underflow
2

insira a descrição da imagem aqui

Funciona para mim

Etapa 1: adicione suas devDependencies: " @ babel / compat-data": "7.8.0 "

Etapa 2: executar - instalação do npm

Abdullah Pariyani
fonte