You can use:
npx <command>
npx
looks for command in .bin
directory of your node_modules
Store the following in a file called npm-exec.bat
and add it to your %PATH%
@echo off
set cmd="npm bin"
FOR /F "tokens=*" %%i IN (' %cmd% ') DO SET modules=%%i
"%modules%"\%*
Then you can use it like
npm-exec <command> <arg0> <arg1> ...
For example
To execute wdio
installed in local node_modules directory, do:
npm-exec wdio wdio.conf.js
i.e. it will run .\node_modules\.bin\wdio wdio.conf.js