npm scripts are not detected in npm-window anymore

I updated Webstorm to 2021.1 last FridayFrom that moment on the npm-windows does not show the script definition of the projects package.json anymore.

When I do open the run configuration it also shows "No npm script"
However, when I do press "Run" and then "Continue Anyway" the script is executed correctly!

 

0
6 comments

looks as if package.json is treated as plain text, not as JSON. Please check the registered patterns in Settings | Editor | File types, Text and Auto-detect file type by content file types - can you see package.json pattern there? Also, what file type is *.json pattern assigned to? Make sure that the latter is listed as either JSON or JSON5 type

1

Nikita Bobers I clicked package.json right mouse contextmenu, clicked "Override File Type" to choose "JSON", and then it works fine

1

Elena Pogorelova I've same issue after today update v2021.2

0

I had the same issue with 2021.1 as well. Not sure why *.json was removed from the json file type matching, but adding it back manually resolved the issue. I wish this had been fixed automatically in an update instead of requiring so much searching to resolve.

0

I had today the very same problem with 2021.2 on Mac with M1 chip. For some reason when I launched IntelliJ as admin it did worked, so I thought it‘s a problem with hombrew and where it downloads packages (can‘t be access without sudo). I solved it by installing yarn with npm instead but maybe it was not the hombrew’s fault at the end…

0

Please sign in to leave a comment.