Skip to content

TypeError: Cannot read property 'export=' of undefined from ./node_modules\typescript\lib\tsc.js #11211

@georgeedwards

Description

@georgeedwards

TypeScript Version: 2.0.3

Code

When building any project I have started getting th following warning on my windows machine:

C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:37701
[0]                 throw e;
[0]                 ^
[0]
[0] TypeError: Cannot read property 'export=' of undefined
[0]     at checkExternalModuleExports (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:26496:62)
[0]     at checkExportAssignment (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:26474:13)
[0]     at checkSourceElement (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:26642:28)
[0]     at Object.forEach (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:185:30)
[0]     at checkBlock (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:24881:16)
[0]     at checkSourceElement (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:26589:28)
[0]     at checkFunctionExpressionOrObjectLiteralMethodDeferred (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:22975:21)
[0]     at checkDeferredNodes (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:26666:25)
[0]     at checkSourceFileWorker (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:26695:17)
[0]     at checkSourceFile (C:\Users\George\Source\Repos\docs\node_modules\typescript\lib\tsc.js:26680:13)
[0] tsc -w -p ./server exited with code 1

This doesn't seem to have anything to do with my project? Or if it does, the error message isn't helpful.

Expected behavior:
Clean compile, without throwing this error.

This seems to have occurred since I upgraded to node v6.7.0 however, on downgrade the problem remains. To replicate you can clone this repo. and then run npm i

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions