Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom typescript plugin cannot find name 'describe'

I already tried to include a line of typings but that doesnt resolve this issue for me

enter image description here

here is my tsconfig.json file:

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ],
    "types": [
      "jasmine"
    ]
  }
}

the path to node_modules is correct

like image 914
Rachid O Avatar asked Oct 28 '16 11:10

Rachid O


2 Answers

I'm using this temporary solution - while I hope that the atom-typescript plugin can solve it better.

Install the types;

npm install @types/jasmine --save-dev

Added this line into my src/app/app.component.spec.ts file;

import  '../../node_modules/@types/jasmine';

Didn't need to add it into any other spec files, editing just this one file solves the issue for me.

Another work-around I found, works, but not as good as above for me, so depending on your needs was to edit "package.json", by moving the jasmine reference in the "devDependencies" up to the "dependencies" section;

"@types/jasmine": "^2.5.38"
like image 185
Christopher Plewright Avatar answered Oct 23 '22 23:10

Christopher Plewright


I encountered the same issue. To fix it, I removed the typeRoots, and just kept the types array.

like image 33
Byron Avatar answered Oct 23 '22 21:10

Byron