Skip to content

Instantly share code, notes, and snippets.

@ginpei
Last active April 8, 2018 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ginpei/b591baf5e8185720d1f6d9bcf7582dc4 to your computer and use it in GitHub Desktop.
Save ginpei/b591baf5e8185720d1f6d9bcf7582dc4 to your computer and use it in GitHub Desktop.
TS Compiler doesn't work with @types/sinon-chai

Environment

Using WSL (Ubuntu) on Windows 10.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
$ node --version
v8.11.1
$ npm --version
5.6.0

Expected

$ npx tsc --watch
11:12:38 - Starting compilation in watch mode...

11:12:40 - Compilation complete. Watching for file changes.

Actual

It starts but doesn't compile anything.

$ npx tsc --watch
11:12:38 - Starting compilation in watch mode...

Note

It works if you set "module": "commonjs" in tsconfig.json.

{
"devDependencies": {
"@types/sinon-chai": "^2.7.29",
"typescript": "^2.8.1"
}
}
{
"compilerOptions": {
"module": "none"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment