Webstorm 7无法识别节点API方法 [英] Webstorm 7 cannot recognize node API methods

查看:290
本文介绍了Webstorm 7无法识别节点API方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了WebStorm.我正在开发一个小型的Node.js应用.

I just installed WebStorm. I'm working on a small Node.js app.

我已经附加了Node.js源代码,当我单击Node.js设置时,我看到它可以识别我的各种节点模块,等等.

I've attached the Node.js source code, and when I click on the Node.js settings, I can see that it can recognize my various node modules, etc.

我遇到两个问题:

  1. 未解决的变量或类型:WebStorm似乎无法识别简单的API方法(exportsrequire).
  2. 没有代码洞察力……:如果我呼叫require('winston'),它告诉我它没有代码洞察力. (有没有一种方法可以添加源代码?)
  1. Unresolved variable or type: WebStorm doesn't seem to recognize simple API methods (exports, require).
  2. No code insight for…: If I call require('winston'), it tells me that it has no code insight. (Is there a way I can add the source code?)

推荐答案

对于WebStorm 7至10(在OSX上)…

For WebStorm 7 thru 10 (on OSX)…

WebStorm→首选项→语言和框架→Javascript→库

WebStorm → Preferences → Languages & Frameworks → Javascript → Libraries

选择"Node.js全局变量"和"Node.js vXXX核心模块".

Select "Node.js Globals" and "Node.js vXXX Core Modules".

这篇关于Webstorm 7无法识别节点API方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆