Testcafe command not found when installed through "npm install"
It is expected behavior. If you want to use the testcafe
command from the command line, you need to install the testcafe package globally using the -g
argument.
Please refer to the following article to get more details:
https://devexpress.github.io/testcafe/documentation/using-testcafe/installing-testcafe.html
As a feedback on how to install TestCafe, I recommend to install it locally instead of globally, especially if your tests are executed in a CI environment, because a CI environment may be reformatted at any time (like your dev machine) or may be used by different tenants that might each needs a special version of TestCafe.
You can use npx to run any local binary without installing it globally.