Skip to content

error: could not load typescript -> how to set compiler=global typescript instalation? #118

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

Closed
flyon opened this issue Dec 13, 2015 · 2 comments
Labels

Comments

@flyon
Copy link

flyon commented Dec 13, 2015

I just upgraded after quite a while and get the error "Could not load typescript. Try in stalling with npm install typescript".

But I just updated my global npm typescript module, and I don't really want to install typescript for every small project.

Can I somehow point to the local typescript compiler?

npm list typescript -g
C:\Users***\AppData\Roaming\npm
└── typescript@1.7.3

@jbrantly
Copy link
Member

See #35 for a related discussion. The jist of it is that loading globally is discouraged and sometimes doesnt work correctly (for reasons that are unknown to me). TypeScript also recently removed the preferGlobal flag.

That said, ts-loader doesn't do anything special with regards to loading TypeScript locally or globally. It simply does require('typescript') and let's node take care of the rest.

See this comment for a possible workaround using npm link.

@flyon
Copy link
Author

flyon commented Dec 13, 2015

sorry didnt see that issue before. tnx for the info around loading globally, for now npm link typescript works great!

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

No branches or pull requests

2 participants