ale*_*hro 15 javascript node.js webstorm
几乎所有第三方模块WebStorm的自动获取都无法解析方法/字段.在自动完成下,我的意思是所有类似intellisense的功能.例如:
var async = require('async');
async.series() //WebStorm's tooltip says: Unresolved function or method series()
Run Code Online (Sandbox Code Playgroud)
同时它解决了
async.exports.series().
Run Code Online (Sandbox Code Playgroud)
但这会导致运行时错误:
TypeError: Cannot call method 'series' of undefined
Run Code Online (Sandbox Code Playgroud)
对于我自己的模块,我找到了解决方法.如果我在模块中:
var myModule = module.exports;
myModule.someMethod = function(){
...
}
Run Code Online (Sandbox Code Playgroud)
然后someMethod的自动缩放工作正常.
关于以上所有,我有一堆问题.
1.为什么ide无法解析async.series()?
2.为什么async.exports.series()会导致运行时错误?
3.如何进行自动化工作?
WebStorm 5.0.4.
ale*_*hro 12
使用new如下:
var async = new require('async');
Run Code Online (Sandbox Code Playgroud)