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

后端 未结 13 1274
傲寒
傲寒 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:55

    Another solution that helped me a lot is to update all libs in "Node.js and NPM". You need just mark all libs and click blue arrow - 'update'

    0 讨论(0)
  • 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"
      ]
    
    0 讨论(0)
  • 2020-12-04 10:58

    Ok, Here I have seen a lot of answers already given, I want to add some more that are fixed unresolved function/method/variable warning.

    That is resolved "unresolved function or method for 'require' and some other warning"

    Go -> Preferences-> Languages & Frameworks -> Node.js and NPM, then checkmark the "Coding assistance for Node.js"
    

    If you still see this type of warning, unresolved variable or something like that, you can manually disable these warnings by followings.

    Go -> Preferences-> Editor-> Inspections-> JavaScript-> General.  
    

    and you will find a list and just unchecked what warning you want to disable and then apply.

    0 讨论(0)
  • 2020-12-04 10:59

    On WebStorm 2020.1

    WebStorm -> Preferences -> Languages & Frameworks -> Node.js and NPM -> Check Coding assistance for Node.js -> Apply

    0 讨论(0)
  • 2020-12-04 11:00

    For WebStorm 2019.3 File > Preferences or Settings > Languages & Frameworks > Node.js and NPM -> Enable Coding assitance for NodeJs

    Note that the additional packages that you want to use are included.

    0 讨论(0)
  • 2020-12-04 11:01

    Webstorm 11 and 2016.2.3

    Enable Node.js Core library in Webstorm settings.

    0 讨论(0)
提交回复
热议问题