How do I make WebStorm aware of Meteor added packages like Underscore and Moment?

I know these are not Meteor specific libraries but I am adding them through "meteor add".

I get a lot of warnings like "Unresolved function or method moment()" and "Unresolved variable or type _". (There are a lot more but they're all related.)

Thanks for helping this noob.

Comment actions Permalink

One solution would be to manually add them via the settings:
Settings > Languages & Frameworks > JavaScript > Libraries

It's not perfect though. I don't know if there's currently a way in WebStorm 9 to make it aware of the packages you add to Meteor and adapt its index... If there is, I am eager to discover it too!

Comment actions Permalink

This works well enough for me for now. :)

Comment actions Permalink

I think I've stumbled across the right (supported) answer but I don't think it's perfect.

Open /.meteor/packages and then click "Import packages as library". I chose both server and client options. It created two external libraries full of packages.

It's resolved some unresolved library issues I had (just because I didn't bother to import the external library manually) but it broke a few others! haha So jQuery resolves now but Iron Router and MomentJS are both broken.

I think I'll open an issue.


Please sign in to leave a comment.