Why does npm install a bunch of .cmd files on my project root folder?

The problem is solved when I run npm install directly in the folder instead of using npm install --prefix.

This was extracted from the question post and moved here on the author's behalf.


If this is only reproducible when using prefix then it is very possible that it is a bug in npm (there is a similar issue in pnpm that I was going to fix).

There is no workaround to this at the moment. There are no configs to set the bin location. So you should avoid using the prefix config until npm fixes the issue.


This happened to me - the fix on Windows was to go to c:\Users\{username}\.npmrc and remove the prefix.