x)- [x] bug report -> please search issues before submitting
- [ ] feature request
@angular/cli: 1.4.0
node: 6.11.2
os: win32 x64
Create new project with ng new <project>
When building project you will get warning:
[INFO]
[INFO] @angular/[email protected] requires typescript@'>=2.1.0 <2.4.0' but 2.5.3 was found instead.
[INFO] Using this version can result in undefined behaviour and difficult to debug problems.
[INFO]
[INFO] Please run the following command to install a compatible version of TypeScript.
[INFO]
[INFO] npm install typescript@'>=2.1.0 <2.4.0'
And sometimes it will fail (depending on your code) if you build it after you have generated your project.
I have generated project and in the moment of time typescript was at 2.3.2, but after we've started building it on CI it started to fail because it started to install 2.5.x version.
Angular cli should define exact version of typescript (maybe some other dependencies too). In this case to 2.3.2
This is odd. A new project is initialized with typescript@~2.3.3 in package.json: https://github.com/angular/devkit/blob/master/packages/schematics/angular/application/files/package.json
So you can get anything >=2.3.3 <2.4.0, but the version you mention (2.5.x) is outside that range.
Can you verify what version of typescript you have in your project, and show me the result of running npm ls typescript?
I have the same problem. Recently, uninstalled and re-installed node.js and did npm install on my project and am running into this issue. Package.json has typescript set as 2.3.4.
At the global level also, the typescript version installed is 2.3.4. I'm not sure why I'm getting this message.
Also, when I do npm ls typescript , I see 2.5.3. Not sure why I'm seeing this version.
Do I need to uninstall or am i missing something?
Any updates on above issue. I am also facing the same issue.
Providing me with the full output of npm ls typescript could help shed some light on this.
Same error, here is my output fromnpm ls typescript
+-- @angular/[email protected]
| +-- @angular-devkit/[email protected]
| | `-- [email protected] deduped
| `-- [email protected] deduped
`-- [email protected]
@phanf what version do you have in your package.json? It looks like you set it for 2.5.x there.
I think we all did something wrong here. I just did clean ng new with [email protected] and I've got
"typescript": "~2.3.3"
inside my package.json.
I think we can close this one. I guess we were all doing something weird here. Sorry for the troubles.
@filipesilva It was set to "typescript": "^2.5.3" in my package.json, however if I lower the version to "typescript": "~2.3.3" I still get the warning which is not a huge issue.
"devDependencies": {
"@angular/cli": "^1.4.4",
"@angular/compiler-cli": "^4.4.4",
...
"typescript": "~2.3.3"
}
I am having the same problem, package.json is specifying typescript 2.3.3 but when I do the npm install it seems to install 2.5.3 anyways. When I run ng server, I get the same error:
@angular/[email protected] requires typescript@'>=2.1.0 <2.4.0' but 2.5.3 was found instead.
package.json
...
"dependencies": {
"@angular/animations": "^4.4.4",
"@angular/common": "^4.4.4",
"@angular/compiler": "^4.4.4",
"@angular/compiler-cli": "^4.4.4",
"@angular/core": "^4.4.4",
"@angular/forms": "^4.4.4",
"@angular/http": "^4.4.4",
"@angular/platform-browser": "^4.4.4",
"@angular/platform-browser-dynamic": "^4.4.4",
"@angular/platform-server": "^4.4.4",
"@angular/router": "^4.4.4",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.4.5",
"@types/jasmine": "2.6.0",
"@types/node": "^8.0.34",
"angular-ide": "^0.9.23",
"codelyzer": "~3.2.1",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "1.7.1",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"protractor": "~5.1.2",
"ts-node": "3.3.0",
"tslint": "^5.7.0",
"typescript": "^2.3.3"
}
@phanf , try uninstall (or just delete node_modules) modules and do npm install again.
@Wyzbang It's because you have a ^, and not a ~. As I said, I've created a new project with angular/[email protected] and I've got:
"typescript": "~2.3.3"
@slavede thank you that was exactly it. Switching to a ~ got the correct version.
Closing as resolved.
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._
Most helpful comment
@phanf , try uninstall (or just delete node_modules) modules and do npm install again.
@Wyzbang It's because you have a ^, and not a ~. As I said, I've created a new project with angular/[email protected] and I've got:
"typescript": "~2.3.3"