TypeScript getting error TS2304: cannot find name ' require'

后端 未结 23 2641
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:40

    If you can compile code, but Visual Studio 2015 marks 'require' functions as errors with error text cannot find name 'require' or cannot resolve symbol 'require', update TypeScript for Visual Studio 2015 to the latest version (at the moment 2.1.5) and update ReSharper (if you use it) to at least version 2016.3.2.

    I had this annoying problem for a while and couldn't find a solution, but I finally resolved it this way.

提交回复
热议问题