Error | Could not find plugin "proposal-numeric-separator" | Generating ES5 bundles for differential loading
π Bug report
Command (mark with an x)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
Yes, the previous version in which this bug was not present was: a few hours agoDescription
A clear and concise description of the problem...Build doesn't work
π¬ Minimal Reproduction
npm install
node --max-old-space-size=4096 ./node_modules/@angular/cli/bin/ng build --prod
π₯ Exception or Error
Generating ES5 bundles for differential loading...
An unhandled exception occurred: [BABEL] C:\angular\dist\common-es2015.b1722ef05b43f664abc2.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "C:\\angular\\node_modules\\@angular-devkit\\build-angular\\node_modules\\@babel\\preset-env\\lib\\index.js")
See "C:\Users\Vegard\AppData\Local\Temp\ng-J7YoSB\angular-errors.log" for further details.
π Your Environment
Angular CLI: 8.3.25
Node: 12.14.1
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic
... platform-webworker, platform-webworker-dynamic, router
... service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.803.25
@angular-devkit/build-angular 0.803.25
@angular-devkit/build-optimizer 0.803.25
@angular-devkit/build-webpack 0.803.25
@angular-devkit/core 8.3.25
@angular-devkit/schematics 8.3.25
@angular/cdk 8.2.3
@angular/cli 8.3.25
@angular/material 8.2.3
@angular/pwa 0.803.25
@ngtools/webpack 8.3.25
@schematics/angular 8.3.25
@schematics/update 0.803.25
rxjs 6.5.4
typescript 3.5.3
webpack 4.39.2
Anything else relevant?
https://github.com/facebook/create-react-app/issues/8680
I'm working with Yarn 1.22.4 and Angular 8.2.14 on Windows 10. Problem started to occur when I installed ngx-markdown 9.0.0. I had some TypeScript related issue so I downgraded ngx-markdown to 8.2.2. After that I started to get proposal-numeric-separator errors. In my case adding ONLY this...
"resolutions": {
"@babel/preset-env": "^7.8.7"
},
...to the package.json worked. Probably I also removed yarn-lock and node_modules before installing packages once more time (I spent "magic" 1.5h of frustration...). At the same time I "destroyed" my Ubuntu 18.04 VPS . It was working fine on commits before installing ngx-markdown. Nothing was helping - resetting repository to the commit from the past, deleting node_modules, yarn.lock or even upgrading node or yarn versions ;) Looks like when it's broken it's remains broken no matter what you do :P
with me none of previous solutions solved my issue: Just Update Angular-cli in global and also update Node , npm and create another new Project works fine :)
Sticking to previous version of
build-angularjust do the work without any other change (and"@babel/compat-data": "7.8.0"did not work for me, with or without removing the lock)"devDependencies": { "@angular-devkit/build-angular": "=0.803.22", ... }
worked for me, mac and docker(centos)
Make sure you hit npm install before rebuilding your app, or the actual version won't be installed
I was able to build by disabling generating ES5 bundles for differential loading by setting
"browserslist": [ "last 2 Chrome versions" ]in packages.json, and
"es5BrowserSupport": falsein angular.json
Where exactly to add these inside angular.json and package.json? I am a bit new to all this.
Also installing "@babel/compat-data": "7.8.0" did not work for me.
I am using Ionic App
The following worked for me too:
- ADD "@babel/compat-data": "7.8.0" to package.json
- CLEAN node_modules
- DELETE package-lock.json
- RUN npm install
- RUN ng build
Code example (from package.json):
{
"scripts": {
// no change here
},
"dependencies": {
// no change here
},
"devDependencies": {
"@babel/compat-data": "7.8.0" // added
}
}
All above was not working for me. What I did as a TEMPORARY solution (Hence ugly): npm install install @babel/plugin-proposal-numeric-separator --save-dev
Then changed file (And that is what is ugly, because it won't work if you reinstall modules): node_modules@babel\preset-env\lib\available-lugins.js
By adding: var _pluginProposalNumericSeparator = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator"));
And at the bottom, in the _default array, adding: "proposal-numeric-separator": _pluginProposalNumericSeparator
Try to install
"@babel/compat-data": "~7.8.0"todevDependencies. This is the only workaround which helped me.
this did not work for me as well.. but this did..
"devDependencies": { "@babel/core": "^7.7.4", }
CICD Use Case
- I'm building an application on a GitLab instance and deploying to kubernetes.
- The project is
@angular/cliversion 7.x.x and I want to use Node.js 12 in my Dockerfile.
I clone the repo to remove the package lock and the node_modules file / folder.
I add this suggestion from above to my package.json then do a quick install to generate a new package-lock.json, and then I modify my Dockerfile. This particular project doesn't require me to compile so I'm doing everything in the Dockerfile.
FROM custom-registry/nodejs-devops:12-lts_v2.0.0 as node
WORKDIR /app
COPY . .
#################################################
RUN npm install && npx npm-force-resolutions
##################################################
ENV NODE_ENV=production
RUN npm run build
FROM custom-registry/nginx-devops:1.16-lts_v2.0.0
EXPOSE 8080
COPY --from=node /app/dist /usr/share/nginx/html
Can confirm that manually adding "@babel/compat-data": "~7.8.0" to the devDependencies works.
You need to explicitly tell it to use version 7.8.0 (using ~ rather than ^) since any newer versions will not work.
For anyone experiencing this issue, Angular CLI 8.3.26 has been released with an update to the babel versions. No workarounds should be necessary after an update. When updating, please ensure that the @angular-devkit/build-angular package was also updated to 0.803.26. This package contains the majority of the build logic for the CLI.
If anyone is still encountering issues after an update, please open a new issue with details regarding your environment and project versions.
npm i @babel/[email protected] worked for me. Check the followings as well.
Results of ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ β³ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 8.3.25
Node: 10.16.3
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.803.25
@angular-devkit/build-angular 0.803.25
@angular-devkit/build-optimizer 0.803.25
@angular-devkit/build-webpack 0.803.25
@angular-devkit/core 8.3.25
@angular-devkit/schematics 8.3.25
@angular/cli 8.3.25
@ngtools/webpack 8.3.25
@schematics/angular 8.3.25
@schematics/update 0.803.25
rxjs 6.4.0
typescript 3.5.3
webpack 4.39.2````
Try to install
"@babel/compat-data": "~7.8.0"todevDependencies. This is the only workaround which helped me.
works for me too (Y) thanks
Try to install
"@babel/compat-data": "~7.8.0"todevDependencies. This is the only workaround which helped me.
npm i @babel/[email protected] this worked fine. thanks
I had the same problem, when building angular app. I just updated my packages and then it worked.
1.delete node_modules and package-lock.json 2.add βresolutionsβ: { β@babel/preset-envβ: β^7.8.7β }, to package.json 3.npm install npm-force-resolutions --save-dev 4.npm install 5.npx npm-force-resolutions 6.npm install again 7.then run your app
https://forum.ionicframework.com/t/how-to-resolve-babel-error-when-installing-geolocation-in-ionic-app/185542/3
I solved this problem as follows:
"devDependencies": {
"@angular-devkit/architect": "~0.801.2",
...
in package.json.
then I did npm install to apply the changes.
got this error while running ng build. Solution
- add "@babel/compat-data": "~7.8.0" to devDependencies.
- npm install
got this error while running ng build. Solution
1. add "@babel/compat-data": "~7.8.0" to devDependencies. 2. npm install
Helped me as well.
got this error while running ng build. Solution
1. add "@babel/compat-data": "~7.8.0" to devDependencies. 2. npm installHelped me as well.
Same for me, started experiencing this error after updating an Ionic 4 app to Ionic 5 and building with Ionic Pro. All fine after adding this.