Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I'm updating angular 5 to 6V.
I followed all the steps in the guide -
https://update.angular.io/?v=5.2-6.0
ng version
Angular CLI: 6.2.9
Node: 14.15.5
OS: linux x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.8.9
@angular/cdk 5.2.5
@angular/cli 6.2.9
@angular/material 5.2.5
@angular/platform-server 5.2.10
@ngtools/webpack 6.0.8
@schematics/angular 0.8.9
@schematics/update 0.8.9
rxjs 6.0.0
typescript 2.9.2
webpack 4.8.3
now when im running ng serve
I'm getting a large error msg regarding my @type
example:
ERROR in node_modules/@types/babel__traverse/index.d.ts(68,50): error TS1005: ']' expected.
node_modules/@types/babel__traverse/index.d.ts(68,53): error TS1005: ';' expected.
node_modules/@types/babel__traverse/index.d.ts(68,58): error TS1005: ';' expected.
node_modules/@types/babel__traverse/index.d.ts(68,70): error TS1011: An element access expression should take an argument.
node_modules/@types/babel__traverse/index.d.ts(68,83): error TS1005: ';' expected.
node_modules/@types/babel__traverse/index.d.ts(68,84): error TS1128: Declaration or st
In my research, I saw that I have to update Typescript to a newer version,
when updating to the latest im getting an error saying I must use typescript@">=2.7.2 <2.10" (now im using "typescript": "^2.9.2",
)
I ran this command but it still returns the same error.
Any idea?
–
–
Less offensive approach is to add babel dependencies to your package.json file:
"typescript": "3.8.3",
"@types/babel__core": "7.1.18",
"@types/babel__traverse": "7.14.2",
After this run npm install
You can match babel version to typescript by information included in their package repositories (check column named 'Tag').
https://www.npmjs.com/package/@types/babel__traverse?activeTab=versions
https://www.npmjs.com/package/@types/babel__core?activeTab=versions
In my case babel version was overridden by newest because of installation of other package that depend on it.
Solution author:
https://stackoverflow.com/a/74824145/9950085
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.