Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm WARN [email protected] requires a peer of typescript@>=2.0 but none is installed #788

Closed
papb opened this issue Feb 25, 2019 · 2 comments

Comments

@papb
Copy link
Contributor

papb commented Feb 25, 2019

I've seen issue #775 already, which was closed as a duplicate of #765. That issue is currently closed, but looks like the problem persists, unless I am missing something obvious (for which I apologize in advance).

Steps to reproduce:

  • npm i -g typescript
  • tsc -v gives 3.3.3333
  • npm i -g ts-node gives npm WARN [email protected] requires a peer of typescript@>=2.0 but none is installed
  • ts-node gives Error: Cannot find module 'typescript'

The issues mentioned above seem to suggest that typescript and ts-node should be installed locally; but the README says that ts-node can be installed globally.

Am I missing something? Thanks :)

@blakeembrey
Copy link
Member

blakeembrey commented Feb 25, 2019

It's described in the issue you linked to: #765 (comment). You can install ts-node globally, you can not install typescript globally. It's was definitely a bug when released, but it's part of 8.x now and I'm not in a rush to change this.

Edit: There's also no way to work around the NPM warning excepting removing it from peer dependencies altogether, which is a possibility.

@papb
Copy link
Contributor Author

papb commented Feb 25, 2019

@blakeembrey - Fair enough, but at least this should be stated clearly somewhere. I will open a PR, please take a look :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants