I’ve faced similar issues with npm scripts in WebStorm where the IDE doesn’t recognize a locally referenced package correctly. In my case, the problem was linked to how the path to the executable was interpreted within the IDE’s working environment. I had to adjust the path to be more explicit and sometimes even use node to invoke the script directly. It was also useful to double-check that the project configuration pointed correctly to the Node.js installation. Experimenting with these settings helped to reveal subtle differences in how the IDE handles local versus global packages.
In a situation like this, it is important to verify that the script’s execution context in WebStorm aligns with what is specified in package.json. In my case, changing the way the script was executed helped clear the error. I modified the command to invoke node explicitly, which allowed the IDE to correctly resolve the package path in the custom modules directory. Additionally, reviewing the project’s settings so that the working directory accurately pointed to the project root was essential. Ultimately, aligning both the command and the working directory configuration resolved the issue without further complications.
hey, try prepending ‘node’ to your script call. i had similar issues caused by webstorm not picking up local paths correctly. check that and your workspace settings, might just do the trick!