【问题标题】:Node.js intellisense in WebStorm and/or VS CodeWebStorm 和/或 VS Code 中的 Node.js 智能感知
【发布时间】:2016-02-15 06:26:43
【问题描述】:

是我还是 Visual Studio Code 和 Webstorm 10 中没有 node.js 智能感知? 例如,当我有 var http = require('http') 时,http. 不包括 createServer 作为建议。

如何让智能感知工作?

【问题讨论】:

    标签: node.js intellisense webstorm visual-studio-code


    【解决方案1】:

    在 webstorm 中为 node.js 核心模块启用智能感知,您需要配置节点源,这可以在设置 -> 语言和框架 -> Node.js 和 NPM -> 单击配置下完成。 Webstorm 将下载安装在您系统上的节点版本的源代码并将其附加到打开的项目中。享受 Webstorm 令人敬畏的智能感知。 :)

    【讨论】:

      【解决方案2】:

      对于 VisualStudio 代码:

      首先,安装 Typings

      npm install -g typings
      

      然后,使用 Typings 命令行,下拉 Node.js 和 Express 类型定义文件

      typings install dt~node --global
      typings install dt~express dt~serve-static dt~express-serve-static-core --global
      

      您可以从以下网址找到更多详细信息: https://code.visualstudio.com/Docs/runtimes/nodejs

      【讨论】:

        猜你喜欢
        • 2020-09-06
        • 1970-01-01
        • 2017-06-06
        • 2019-12-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-09-16
        • 1970-01-01
        相关资源
        最近更新 更多