grunt-ts icon indicating copy to clipboard operation
grunt-ts copied to clipboard

Unmet dependency typescript 2.3.3 || ~1

Open GaikwadPratik opened this issue 8 years ago • 5 comments

While installing I am getting below error:

C:\Users\pratik\Documents\GitHub\CS810W2>npm install --save-dev grunt-ts
[email protected] C:\Users\pratik\Documents\GitHub\CS810W2\
+-- [email protected]
`-- UNMET PEER DEPENDENCY typescript@^2.3.3 || ~1

The typescript installed is 2.4.2.

C:\Users\pratik\Documents\GitHub\CS810W2>tsc -v
Version 2.4.2

The typescript is installed globally. Still getting the above issue. But when typescript is installed locally, this issue doesn't occur.

GaikwadPratik avatar Jul 21 '17 03:07 GaikwadPratik

what version of npm do you have?

nycdotnet avatar Jul 21 '17 11:07 nycdotnet

@nycdotnet 4.1.2

GaikwadPratik avatar Jul 21 '17 13:07 GaikwadPratik

Thanks for the reply, @GaikwadPratik . I think this is a "problem" with npm - not really a bug but just something weird about how it works with peer dependencies vs things installed globally.

Is your concern that you are getting a warning you don't expect, or is grunt-ts not working with your global TypeScript?

If the latter, what is the problem with installing TypeScript in the project? That's typically the way I see things work best because it allows each project to have a stable TypeScript compiler version.

nycdotnet avatar Jul 21 '17 14:07 nycdotnet

@nycdotnet I am getting issue with grunt-ts not working when TypeScript is installed globally. I understand that each project needs a stable TypeScript compiler but isn't that the whole point of installing TS globally. I was merely wondering why TS has to be duplicated when available globally?

GaikwadPratik avatar Jul 21 '17 15:07 GaikwadPratik

Well to be honest I thought it would work with the globally installed TS if TypeScript wasn't there. I can't change the npm warning, but I agree this is a grunt-ts bug. I will investigate.

For now, install TypeScript locally.

nycdotnet avatar Jul 21 '17 15:07 nycdotnet