8
votes

When trying to compile typescript files in webstorm, I am bombarded with compilation errors that originate from files in the node_modules folder.

My .tsconfig looks like

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "noImplicitAny": true,
    "sourceMap": true
  },
  "exclude": [
    "node_modules"
  ]
}

and I have 'use .tsconfig.json' checked in preferences > typescript.

The errors I'm getting are from the 'reflect-metadata/Reflect' package

TS2304: Cannot find name 'msCrypto'
2
works for me (WebStorm 11.0.2). I'd suggest creating a support ticket, providing the project that shows up the issue to supportlena
here the same problem. WebStorm 2016.1 (WS-145.258)moohkooh
You may want to double check the file name, you keep saying .tsconfig.json when I've always thought it should just be tsconfig.json (no leading dot).Corey Ogburn

2 Answers

1
votes

update to 2016.1.1 and activate tsconfig.json in the settings:

enter image description here

0
votes

I had to change

"exclude": [
    "node_modules"
]

to

"exclude": [
        "./node_modules"
]

I am using

WebStorm version