The issue sometimes is due to NPM path not getting added to path variable , so you can edit the path variable for your user in environment variables and add NPM path usually it is
C:\Users\username\AppData\Roaming\npm on windows machine.
If this does not work you add bin path for SF cli, same path as above with
\node_modules\@salesforce\cli\bin