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

Cannot find modules and type definition files #8

Open
ajsb85 opened this issue Jul 7, 2017 · 5 comments
Open

Cannot find modules and type definition files #8

ajsb85 opened this issue Jul 7, 2017 · 5 comments

Comments

@ajsb85
Copy link

ajsb85 commented Jul 7, 2017

$ npm test

> typescript-node-api@1.0.1 test /Users/username/GitHub/typescript-node-api
> mocha --reporter spec --compilers ts:ts-node/register 'test/**/*.test.ts'


/Users/username/GitHub/typescript-node-api/node_modules/ts-node/src/index.ts:312
          throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
                ^
TSError: ? Unable to compile TypeScript
Cannot find type definition file for 'body-parser'. (2688)
Cannot find type definition file for 'chai'. (2688)
Cannot find type definition file for 'chai-http'. (2688)
Cannot find type definition file for 'debug'. (2688)
Cannot find type definition file for 'express'. (2688)
Cannot find type definition file for 'express-serve-static-core'. (2688)
Cannot find type definition file for 'mime'. (2688)
Cannot find type definition file for 'mocha'. (2688)
Cannot find type definition file for 'morgan'. (2688)
Cannot find type definition file for 'node'. (2688)
Cannot find type definition file for 'serve-static'. (2688)
test/helloWorld.test.ts (1,24): Cannot find module 'mocha'. (2307)
test/helloWorld.test.ts (2,23): Cannot find module 'chai'. (2307)
test/helloWorld.test.ts (3,27): Cannot find module 'chai-http'. (2307)
test/helloWorld.test.ts (5,17): Cannot find module '../src/App'. (2307)
test/helloWorld.test.ts (10,1): Cannot find name 'describe'. (2304)
test/helloWorld.test.ts (12,3): Cannot find name 'it'. (2304)
test/helloWorld.test.ts (19,3): Cannot find name 'it'. (2304)
@mjhea0
Copy link
Owner

mjhea0 commented Aug 2, 2017

Is this still an issue?

@jhenrich
Copy link

jhenrich commented Aug 23, 2017

I get the exact same error on my side.

// Edit
I just updated my ts-node packages to the latest version and now it works

@mjhea0
Copy link
Owner

mjhea0 commented Aug 23, 2017

Strange. Can I see your package.json?

@hoangnguyenba
Copy link

hoangnguyenba commented Oct 31, 2017

Same to me. Here's my packag:
typescript-node-api@1.0.1 /Users/hoangnguyen/projects/tavi/srccode/api ├── @types/body-parser@1.16.7 ├── @types/chai@4.0.4 ├── @types/chai-http@3.0.3 ├── @types/debug@0.0.30 ├── @types/express@4.0.39 ├── @types/mocha@2.2.44 ├── @types/morgan@1.7.35 ├── @types/node@8.0.47 ├── body-parser@1.18.2 ├── chai@3.5.0 ├── chai-http@3.0.0 ├── debug@2.6.9 ├── express@4.16.2 ├── gulp@3.9.1 ├── gulp-typescript@3.2.3 ├── mocha@3.5.3 ├── morgan@1.9.0 ├── ts-node@1.7.3 └── typescript@2.5.3

@themese
Copy link

themese commented Apr 27, 2018

Hi,
I'm just training myself in node + express and found out this issue by chance.
I solved it by removing the single quotes in
mocha --reporter spec --compilers ts:ts-node/register 'test/**/*.test.ts'
so it looks like this:
mocha --reporter spec --compilers ts:ts-node/register test/**/*.test.ts

Probably everybody by now already know this, but in case somebody comes late to the party same as I did :)

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

5 participants