You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start up app with ng serve and this message is displayed:
@angular/compiler-cli@4.3.6 requires typescript@'>=2.1.0 <2.4.0' but 2.5.2 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.1.0 <2.4.0'
To disable this warning run "ng set --global warnings.typescriptMismatch=false".
Reacted by Chris Marx, Francesco Borzì, alexandersokolov, Dai, Philipp Kief, Edric Chan, Amerzel, bb010g, Erik, Sean G. Wright and 31 more
Anyway it would be good if @angular/compiler-cli would define the correct peer dependency here: https://github.com/angular/angular/blob/4.4.x/packages/compiler-cli/package.json#L17. Not everybody is using angular-cli. I can understand the safety check, but I am not sure the matrix linked by kuncevic should be the correct place to specify the requirements.
There were no indications that this restriction would be implemented. The only thing I updated in my project was the CLI. The @angular/compiler-cli@4.3.6 has no problems previously.
These versions shown in the warning are the ones recommended by the Angular team.
A lot of bugs that are reported are actually the result of using incompatible versions, and it is not clear at all what these versions are. This is not a new restriction: incompatible versions have caused problems for a while now.
It is true that other typescript versions may work in your particular project - but we cannot guarantee they will work. That is why we show a warning now (but not an error).
It became more important to alert users to what the recommended versions are because Angular version 5 is coming out and it has its own recommend set of typescript versions.
There are two factors preventing simply adding a strict dependency:
the CLI must support Angular versions 2, 4, and 5
Angular itself does not have a dependency/peer dependency on typescript
So it was better to show a warning than to prevent usage of other typescript versions. If you feel confident that your project should work with other versions of typescript, you can disable the warning. This is useful when using versions of libraries that specifically need typescript of a certain version for compilation to be successful.
Reacted by Sean G. Wright, Lex Kuncevic, D, Francesco Borzì, Kim Kern, Philipp Kief, Christoffer Eenberg, Juan Francisco Ottonello, Juan Valencia, Caio Campos and 7 more
@filipesilva : Thanks for the high-level explanation.
For those of us who wish to "scout ahead" using TypeScript versions beyond what is recommended, is there a place where any known issues (with or without a fix/work-around) have been documented?
Reacted by Francesco Borzì, Philipp Kief, xnnkmd, Adrien Crivelli, Shmulik Flint and Jan Melcher
Hi guys...
Having the same issue with @angular/compiler-cli@4.4.3
Node: 8.4.0
Typescript: 2.5.2
But as we can see in the package.json of angular/compiler-cli, it saids, in its peerDependencies, that it needs typescript ^2.0.2, and typescript@2.5.2 should meet this requirement
On 2. Oct 2017, at 12:29, Filipe Silva ***@***.***> wrote:
@dherges that's actually a limitation of the CLI architecture currently... the CLI (specifically ngtools/webpack) really wants to use the local project typescript, but the global CLI doesn't have a local project and thus it would have missing peerdeps.
The answer is, of course, to have two CLI packages: one for global and one for local, installing different dependencies. This is a goal for CLI 2.0, but would be disruptive now so we don't do it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
It seems this is still the case today that the latest Angular Compiler requires an older version of TypeScript, but just the compiler. I mean we are talking minor version limitations not major versions this seems odd. It should require just a min or greater version and block the next major version.
Currently today you get this error:
The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.4.5 was found instead.
Seem like it should just require TypeScript >=3.1.1 and <4.0.0 until there is a broken minor release which would hopefully be rare.
Should we just always assume that if we want to use the latest stable release of Angular we always have to run versions behind the latest stable version of Typescript?
Currently, it doesn't support anything newer than 3.2.4 and there have been other released versions since then. The current released version is Typescript 3.4.5.
So based on your statement shouldn't Typescript 3.4.5 be supported then?
Closing the initial reported issue should be solved by now.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
Activity
kuncevic commentedon Sep 8, 2017
Based on that commit it should allow
2.5+but I have same issue even with2.4.2and angular4.3.6UPDATE: Based on that sounds like
typescript: '>=2.4.0 <2.6.0'required angular compiler'>=5.0.0 <6.0.0'karser commentedon Sep 8, 2017
Newly created project with
angular-cli@1.4.0requirestypescript@~2.3.3kondi commentedon Sep 8, 2017
Is this requirement valid? My project looks fine with typescript@2.4.2 and I was planning to go for 2.5.x but now I am not sure if it is a good idea.
kondi commentedon Sep 8, 2017
Anyway it would be good if @angular/compiler-cli would define the correct peer dependency here: https://github.com/angular/angular/blob/4.4.x/packages/compiler-cli/package.json#L17. Not everybody is using angular-cli. I can understand the safety check, but I am not sure the matrix linked by kuncevic should be the correct place to specify the requirements.
jtsom commentedon Sep 8, 2017
There were no indications that this restriction would be implemented. The only thing I updated in my project was the CLI. The @angular/compiler-cli@4.3.6 has no problems previously.
filipesilva commentedon Sep 8, 2017
These versions shown in the warning are the ones recommended by the Angular team.
A lot of bugs that are reported are actually the result of using incompatible versions, and it is not clear at all what these versions are. This is not a new restriction: incompatible versions have caused problems for a while now.
It is true that other typescript versions may work in your particular project - but we cannot guarantee they will work. That is why we show a warning now (but not an error).
It became more important to alert users to what the recommended versions are because Angular version 5 is coming out and it has its own recommend set of typescript versions.
There are two factors preventing simply adding a strict dependency:
So it was better to show a warning than to prevent usage of other typescript versions. If you feel confident that your project should work with other versions of typescript, you can disable the warning. This is useful when using versions of libraries that specifically need typescript of a certain version for compilation to be successful.
fmorriso commentedon Sep 8, 2017
@filipesilva : Thanks for the high-level explanation.
For those of us who wish to "scout ahead" using TypeScript versions beyond what is recommended, is there a place where any known issues (with or without a fix/work-around) have been documented?
xnnkmd commentedon Sep 13, 2017
@filipesilva See also #7678 which would help a lot related to the warning.
TitaneBoy commentedon Sep 20, 2017
Hi guys...
Having the same issue with @angular/compiler-cli@4.4.3
Node: 8.4.0
Typescript: 2.5.2
But as we can see in the package.json of angular/compiler-cli, it saids, in its peerDependencies, that it needs typescript ^2.0.2, and typescript@2.5.2 should meet this requirement
dherges commentedon Sep 27, 2017
Maybe the
dependencieson typescript should be apeerDependencies?A CLI project may now cause more confusion:
4 remaining items
dherges commentedon Oct 2, 2017
filipesilva commentedon Oct 2, 2017
It would, but asking people to install both the cli and typescript globally isn't a good solution either imho.
dherges commentedon Oct 27, 2017
Is it right, that anguilar cli now uses the typescript version installed ion the user's project workspace?
fix(@angular/cli): remove typescript dependency
a28a967
#8185
filipesilva commentedon Oct 27, 2017
@dherges it almost always did, except when the dependency wasn't hoisted. That PR is meant to address that case.
CreepyGnome commentedon May 14, 2019
It seems this is still the case today that the latest Angular Compiler requires an older version of TypeScript, but just the compiler. I mean we are talking minor version limitations not major versions this seems odd. It should require just a min or greater version and block the next major version.
Currently today you get this error:
Seem like it should just require TypeScript >=3.1.1 and <4.0.0 until there is a broken minor release which would hopefully be rare.
Should we just always assume that if we want to use the latest stable release of Angular we always have to run versions behind the latest stable version of Typescript?
alan-agius4 commentedon May 14, 2019
@CreepyGnome, Typescript minor version can be breaking and that's why we only support versions that have been released.
CreepyGnome commentedon May 14, 2019
Currently, it doesn't support anything newer than 3.2.4 and there have been other released versions since then. The current released version is Typescript 3.4.5.
So based on your statement shouldn't Typescript 3.4.5 be supported then?
alan-agius4 commentedon May 14, 2019
It is supported in version 8 release candidate.
alan-agius4 commentedon May 14, 2019
Closing the initial reported issue should be solved by now.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
angular-automatic-lock-bot commentedon Sep 9, 2019
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.