WebStorm 2017.2.3. False "Module is not listed in package.json". It isn't reading my package.json.

I am getting "Module is not listed in package.json" waring for all the imports listed in my package.json.

They most definitely are listed in the package.json of this project...I see them there. dependencies and devDependencies.

It's as if the IDE is not reading my package.json file. Any suggestions?

8 comments

haven't heard of such issues. Is your package.json located in your project root folder? Do you have any symlinks in the project path?  Can you recreate the issue in a new project?

0

No, I do not see it in other projects. Is there someway to have it re-scan or recreate the project info for this one project?

0

No... Please provide the project so that I can advise on fixing the issue

0

It works as expected when I open it with WebStorm on my other machine. It isn't the code in this case...it's something wonky with the settings for this project on this particular computer. Hmmm..

0

Could you please provide your settings (File > Export settings) and your project (or at least a screenshot of project structure, package.json, screenshot of the error)?

0

Same problem here. Happened after one of the webstorm updates.

I can provide settings.jar, where to send it?

0

I've seen the same problem in PhpStorm  2017.2.1 and 2017.2.4. I also had the error 'unresolved function or method require'.

These steps cured both, but I'm not sure if all steps are necessary, steps 2 and 3 might be enough:

1. Settings -> Languages & Frameworks -> Javascript -> Libraries:  add 'Frameword Type: Node.js Core Modules'

2. Settings -> Node.js and NPM -> Enabled 'Node.js Core Library'

3. File -> Invalidate Caches / Restart

0

After applying the three steps mentioned in my previous post, PhpStorm stopped recognizing methods on my imported vue object, so I ended up deleting the '.idea' directory and re-configuring the project from scratch. Now everything's working.

0

Please sign in to leave a comment.