question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[server-only] [typescript] Typescript "Cannot find" many (all?) modules

See original GitHub issue

Running gulp server.compile_tsc

server/api/todo/dao/todo-dao.ts(1,27): error TS2307: Cannot find module 'mongoose'. server/api/todo/dao/todo-dao.ts(2,26): error TS2307: Cannot find module 'bluebird'. server/api/todo/dao/todo-dao.ts(3,20): error TS2307: Cannot find module 'lodash'. server/api/todo/model/todo-model.ts(1,27): error TS2307: Cannot find module 'mongoose'. server/api/todo/controller/todo-controller.ts(1,26): error TS2307: Cannot find module 'express'. server/api/todo/routes/todo-routes.ts(3,26): error TS2307: Cannot find module 'express'. server/commons/static/index.ts(3,26): error TS2307: Cannot find module 'express'. server/commons/static/index.ts(4,21): error TS2307: Cannot find module 'fs'. server/commons/static/index.ts(8,19): error TS2304: Cannot find name 'process'. server/config/db.conf.ts(3,27): error TS2307: Cannot find module 'mongoose'. server/config/db.conf.ts(4,15): error TS2304: Cannot find name 'require'. server/config/db.conf.ts(8,20): error TS2304: Cannot find name 'process'. server/config/db.conf.ts(8,61): error TS2304: Cannot find name 'process'. server/config/routes.conf.ts(3,26): error TS2307: Cannot find module 'express'. server/config/routes.conf.ts(4,25): error TS2307: Cannot find module 'morgan'. server/config/routes.conf.ts(5,29): error TS2307: Cannot find module 'body-parser'. server/config/routes.conf.ts(6,25): error TS2307: Cannot find module 'helmet'. server/config/routes.conf.ts(10,29): error TS2304: Cannot find name 'process'. server/config/routes.conf.ts(11,21): error TS2304: Cannot find name 'process'. server/routes/index.ts(1,26): error TS2307: Cannot find module 'express'. server/server.ts(3,22): error TS2304: Cannot find name 'process'. server/server.ts(4,5): error TS2304: Cannot find name 'require'. server/server.ts(6,12): error TS2304: Cannot find name 'process'. server/server.ts(8,26): error TS2307: Cannot find module 'express'. server/server.ts(9,21): error TS2307: Cannot find module 'os'. server/server.ts(10,23): error TS2307: Cannot find module 'http'. server/server.ts(24,34): error TS2304: Cannot find name 'process'.

The errors are also in Atom with the TypeScript package install.

I’ve tried doing ‘typings install’ to no avail, and removing the typings folder from the exclude stanza in my tsconfig to no avail - the latter spits out tons of “duplicate identifier” errors:

typings/main/ambient/node/index.d.ts(1734,9): error TS2300: Duplicate identifier 'passphrase'. typings/main/ambient/node/index.d.ts(1735,9): error TS2300: Duplicate identifier 'cert'. typings/main/ambient/node/index.d.ts(1736,9): error TS2300: Duplicate identifier 'ca'. typings/main/ambient/node/index.d.ts(1737,9): error TS2300: Duplicate identifier 'crl'. typings/main/ambient/node/index.d.ts(1738,9): error TS2300: Duplicate identifier 'ciphers'. typings/main/ambient/node/index.d.ts(1740,36): error TS2300: Duplicate identifier 'context'. typings/main/ambient/node/index.d.ts(1813,9): error TS2300: Duplicate identifier 'key'. typings/main/ambient/node/index.d.ts(1814,9): error TS2300: Duplicate identifier 'padding'. typings/main/ambient/node/index.d.ts(1817,9): error TS2300: Duplicate identifier 'key'. typings/main/ambient/node/index.d.ts(1818,9): error TS2300: Duplicate identifier 'passphrase'. typings/main/ambient/node/index.d.ts(1819,9): error TS2300: Duplicate identifier 'padding'. typings/main/ambient/node/index.d.ts(1828,18): error TS2300: Duplicate identifier 'Stream'. typings/main/ambient/node/index.d.ts(1833,9): error TS2300: Duplicate identifier 'highWaterMark'. typings/main/ambient/node/index.d.ts(1834,9): error TS2300: Duplicate identifier 'encoding'. typings/main/ambient/node/index.d.ts(1835,9): error TS2300: Duplicate identifier 'objectMode'. typings/main/ambient/node/index.d.ts(1838,18): error TS2300: Duplicate identifier 'Readable'. typings/main/ambient/node/index.d.ts(1854,9): error TS2300: Duplicate identifier 'highWaterMark'. typings/main/ambient/node/index.d.ts(1855,9): error TS2300: Duplicate identifier 'decodeStrings'. typings/main/ambient/node/index.d.ts(1856,9): error TS2300: Duplicate identifier 'objectMode'. typings/main/ambient/node/index.d.ts(1859,18): error TS2300: Duplicate identifier 'Writable'. typings/main/ambient/node/index.d.ts(1871,9): error TS2300: Duplicate identifier 'allowHalfOpen'. typings/main/ambient/node/index.d.ts(1875,18): error TS2300: Duplicate identifier 'Duplex'. typings/main/ambient/node/index.d.ts(1889,18): error TS2300: Duplicate identifier 'Transform'. typings/main/ambient/node/index.d.ts(1911,18): error TS2300: Duplicate identifier 'PassThrough'. typings/main/ambient/node/index.d.ts(1916,9): error TS2300: Duplicate identifier 'showHidden'. typings/main/ambient/node/index.d.ts(1917,9): error TS2300: Duplicate identifier 'depth'. typings/main/ambient/node/index.d.ts(1918,9): error TS2300: Duplicate identifier 'colors'. typings/main/ambient/node/index.d.ts(1919,9): error TS2300: Duplicate identifier 'customInspect'. typings/main/ambient/node/index.d.ts(1980,5): error TS2300: Duplicate identifier 'export='. typings/main/ambient/node/index.d.ts(1988,9): error TS2300: Duplicate identifier 'isRaw'. typings/main/ambient/node/index.d.ts(1990,9): error TS2300: Duplicate identifier 'isTTY'. typings/main/ambient/node/index.d.ts(1993,9): error TS2300: Duplicate identifier 'columns'. typings/main/ambient/node/index.d.ts(1994,9): error TS2300: Duplicate identifier 'rows'. typings/main/ambient/node/index.d.ts(1995,9): error TS2300: Duplicate identifier 'isTTY'. typings/main/ambient/node/index.d.ts(2002,18): error TS2300: Duplicate identifier 'Domain'. typings/main/ambient/serve-static/index.d.ts(85,5): error TS2300: Duplicate identifier 'export='. typings/main/definitions/bluebird/index.d.ts(742,1): error TS2300: Duplicate identifier 'export='. typings/main/definitions/bluebird/index.d.ts(746,1): error TS2300: Duplicate identifier 'export='. typings/main/definitions/bluebird/index.d.ts(750,1): error TS2300: Duplicate identifier 'export='. typings/main/definitions/lodash/index.d.ts(18287,1): error TS2300: Duplicate identifier 'export='. typings/main/definitions/lodash/index.d.ts(18294,1): error TS2300: Duplicate identifier 'export='. typings/main/definitions/lodash/index.d.ts(18298,1): error TS2300: Duplicate identifier 'export='.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ericmdantascommented, May 3, 2016

After installing the typings, adding /// <reference path="../typings/main.d.ts" /> in server/server.ts and compiling again did the trick.

0reactions
ericmdantascommented, May 3, 2016

Alright, I’ll take a look later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TS cannot find modules - typescript - Stack Overflow
I have ran the generator with the following environment: typescript, react, webpack w/ NPM, gulp. When I run gulp serve I get the...
Read more >
Fixing The "Cannot Find Module" Error In TypeScript
In this article, I explain how to fix "cannot find module" in TypeScript. Install the package. Re-install the dependencies.
Read more >
[2.9.0] - Crash pipeline cannot find module 'typescript' #599
Describe the bug Crash on Node projects without typescript To Reproduce Just use 2.9.0 without typescript installed as peer dependency.
Read more >
Documentation - Module Resolution - TypeScript
In this case, the error would be something like error TS2307: Cannot find module 'moduleA'. Relative vs. Non-relative module imports. Module imports are ......
Read more >
Gotchas - Remix
For example, you can't import "fs-extra" directly into a route module: ... at the top-level scope of your route module that depends on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found