TypeScript getting error TS2304: cannot find name ' require'

后端 未结 23 2941
Happy的楠姐
Happy的楠姐 2020-11-22 06:00

I am trying to get my first TypeScript and DefinitelyTyped Node.js application up and running, and running into some errors.

I am getting the error \"TS2304: Cannot

23条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 06:36

    Sometime missing "jasmine" from tsconfig.json may cause this error. (TypeScript 2.X)

    So add

    "types": [
      "node",
      "jasmine"
    ]
    

    to your tsconfig.json file.

提交回复
热议问题