Repository navigation
Closed
Exac/mark4
#2Description
🐞 Bug report
Command (mark with an x)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Description
When i build project with Angular CLI, I get this error:An unhandled exception occurred: Transform failed with 1 error: error: Invalid version: "15.2-15.3" See "C:\Users\MOHAMM~1\AppData\Local\Temp\ng-JBqIfM\angular-errors.log" for further details.
And in angular-errors.log file:
[error] HookWebpackError: Transform failed with 1 error:
error: Invalid version: "15.2-15.3"
at makeWebpackError (E:\workingfolder\test-app\node_modules\webpack\lib\HookWebpackError.js:48:9)
at E:\workingfolder\test-app\node_modules\webpack\lib\Compilation.js:3057:12
at eval (eval at create (E:\workingfolder\test-app\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:98:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
-- inner error --
Error: Transform failed with 1 error:
error: Invalid version: "15.2-15.3"
at failureErrorWithLog (E:\workingfolder\test-app\node_modules\@angular-devkit\build-angular\node_modules\esbuild\lib\main.js:1557:15)
at E:\workingfolder\test-app\node_modules\@angular-devkit\build-angular\node_modules\esbuild\lib\main.js:1346:29
at E:\workingfolder\test-app\node_modules\@angular-devkit\build-angular\node_modules\esbuild\lib\main.js:637:9
at handleIncomingPacket (E:\workingfolder\test-app\node_modules\@angular-devkit\build-angular\node_modules\esbuild\lib\main.js:734:9)
at Socket.readFromStdout (E:\workingfolder\test-app\node_modules\@angular-devkit\build-angular\node_modules\esbuild\lib\main.js:604:7)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
🌍 Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 13.2.0
Node: 16.13.2
Package Manager: npm 8.4.0
OS: win32 x64
Angular: 13.2.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1302.0
@angular-devkit/build-angular 13.2.0
@angular-devkit/core 13.2.0
@angular-devkit/schematics 13.2.0
@schematics/angular 13.2.0
rxjs 7.5.2
typescript 4.5.5
Reacted by Jean-Matthieu BARBIER, pklime2, jkapongo, Samuel Báez, Cédric Exbrayat, DmitriyIvanko, Joris Debonnet, mohamad reza bazrgari, Daniel Ehrhardt, Björn Kimminich and 76 more
Reacted by vinishgeorge, Christian Hartøft-Nielsen, Vlad Dumbrava, DmitriyIvanko, Muskan Dasani, Darly Goçalves, Hladikes, Alex Ivanov, Ahmed Hodiani, rashminectar and 7 more
Activity
idwebmedia commentedon Jan 29, 2022
Literally was coming here to post the exact error. thanks
jmbarbier commentedon Jan 29, 2022
This comes from browserslist
npx browserslistThe versions interval comes from here :
clearing .browserslistrc makes compilation happy again but this is not a real solution !
idwebmedia commentedon Jan 29, 2022
works. thanks
cvandradg commentedon Jan 30, 2022
Removing content or properly configurating .browserslistrc file fixes it indeed. Thanks @idwebmedia
88 remaining items
alessiostalla commentedon Mar 16, 2022
I'm using Angular 13.2.6 and still have the problem in our CI build (not locally, though).
chalkplum commentedon Mar 16, 2022
I still get this error 13.1.4 with range in browserlist
Angular CLI: 13.1.4
Node: 16.13.0
Package Manager: npm 8.1.4
OS: win32 x64
Angular: 13.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker
Package Version
@angular-devkit/architect 0.1301.4
@angular-devkit/build-angular 13.1.4
@angular-devkit/core 13.1.4
@angular-devkit/schematics 13.1.4
@angular/cdk 13.2.6
@angular/cli 13.1.4
@schematics/angular 13.1.4
rxjs 7.4.0
typescript 4.5.5
i cant go above as i have peer dependency, nice update there i will have to roll back angular to lower version as was ok there,
Fix ng build error
TomCosta commentedon Mar 30, 2022
I have solved that by doing:
Hope it helps.
alessiostalla commentedon Mar 30, 2022
Didn't work for me
fix error: Invalid version: "15.2-15.3"
hoeni commentedon Apr 4, 2022
I had to remove every line resolving to a safari browser from my browserslist to make the build work again. This also means removing lines lie
>1% in de.strarsis commentedon Apr 6, 2022
My approach for a starter project I used (unfamiliar to me):
grep -R 'last 2 Safari major' .npm ls @angular-devkit/build-angularnpm ls @schematics/angular(Using
david, anpmpackage update checker(install it using
npm install -g david/yarn global add david)).david | grep @angular-devkit/build-angularnpm install --legacy-peer-deps --save @angular-devkit/[email protected]david | grep @angular/clinpm install --legacy-peer-deps --save-dev @angular/[email protected]Luckily these updates were enough to also update the browser support configurations in the affected dependencies.
chamikasandamal commentedon Apr 21, 2022
run
npm audit fix --forceor update@angular-devkit/build-angularleonardo-nicolas commentedon Apr 23, 2022
I tried run this command, but I had unsuccessful.
bug
upgrade ng-packagr to fix issue angular/angular-cli#22606 . ng-packag…
martinmolema commentedon May 4, 2022
First updated to Angular using
npm install -g @angular/clioutside the project folder.Then in my project:
Had to remove the node_modules and package-lock.json after updating the version numbers. After that ran
npm installagain and all is working now.In my package.json:
I do not have a
.browserslistrcin my project folderangular-automatic-lock-bot commentedon Jun 4, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.