How can I fix WebStorm warning “Unresolved function or method” for “require” (Firefox Add-on SDK)

后端 未结 13 1388
傲寒
傲寒 2020-12-04 10:38

I\'m using WebStorm 7 for Firefox Add-on SDK development.

WebStorm shows a warning: \"Unresolved function or method\" for require().

I want to g

13条回答
  •  鱼传尺愫
    2020-12-04 10:58

    Working with Intellj 2016, Angular2, and Typescript... the only thing that worked for me was to get the Typescript Definitions for NodeJS

    Get node.d.ts from DefinitelyTyped on GitHub

    Or just run:

    npm install @types/node --save-dev

    Then in tsconfig.json, include

    "types": [
         "node"
      ]
    

提交回复
热议问题