How to stop NodeJS require() being flagged as "unresolved"

I've recently done the WS upgrade to 2018.3 - unfortunately somehow during the course of that some setting's got messed up. So now when I load my NodeJS JS code I'm getting the in-built code inspector, (note, not ESLint, JSHint, etc), complaining that "Unresolved function or method require()".  I've checked online and all the articles say to make sure that "Node.js Core" is enabled in Preferences->Languages & Frameworks->JavaScript->Libraries. I've checked and it is.

So is there some other step I need to do to make sure that WS recognises require() as being known (because it's part of NodeJS). It's also complaining about "module" too as being an "Unresolved variable or type module".

 

Thanks.

9 comments

Must be https://youtrack.jetbrains.com/issue/WEB-35836. Please disable Node.js coding assistance in Preferences | Languages & Frameworks | Node.js and NPM, apply and then re-enable it to get libraries downloaded - does it help?

4

(Sorry for delay - was on vacation)

Thanks @Elena - that does indeed cure my problem!

:-D

2

I have this same problem - applying the settings described by @Elena doesn't work for me.  Running WebStorm 2018.3.2.

0

Confirming that this issue exists in Webstorm 2018.3.3. Steps disable/enable Node.js coding assistance do not work for me.

0

Can JetBrains just reproduce it?  Looks like it's happening for everyone.  I can't supply any files since it's against my company's policy.

0

If we could reproduce it, I won't ask you for steps, logs, etc. And no, it doesn't happen to everyone, it works for almost all users

1

Please sign in to leave a comment.