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

ts-node does not load typings installed with npm #271

Closed
ghost opened this issue Feb 15, 2017 · 1 comment
Closed

ts-node does not load typings installed with npm #271

ghost opened this issue Feb 15, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 15, 2017

ts-node won't recognize typings installed via npm, such as npm install @types/node

to reproduce create a typescript file that imports or uses node modules or globals such as:

import * as path from 'path';
console.log(__dirname);

and run npm -D install @types/node and then ts-node test.ts This will result in these compile errors:

TSError: ⨯ Unable to compile TypeScript
test.ts (1,23): Cannot find module 'path'. (2307)
test.ts (2,13): Cannot find name '__dirname'. (2304)
@blakeembrey
Copy link
Member

Seems like a duplicate of #216.

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

1 participant