2

I've installed testcafe globally on windows 7. When I am connected over ssh It can't find testcafe. error - 'testcafe' is not recognized as an internal or external command

What do I need to do to make it work? thanks

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
A R
  • 77
  • 7
  • Does TestCafe work locally without ssh? – Marion Jul 24 '18 at 11:02
  • it was when I installed it. But it doesn't work right now. – A R Jul 24 '18 at 15:22
  • So, try to re-install TestCafe and let me know if this helps – Marion Jul 25 '18 at 07:07
  • Yes I did. I reinstalled testcafe but it still doesn't work locally and over ssh. – A R Jul 25 '18 at 12:52
  • Right now I can't get it working even locally. – A R Jul 25 '18 at 14:52
  • Did you re-install TestCafe? What error do you see? – Marion Jul 26 '18 at 04:30
  • command is not recognized. But I have that folder in PATH. Testcafe works when I run it from \AppData\Roaming\npm\testcafe. – A R Jul 26 '18 at 19:19
  • It looks like something is wrong with paths. To check this, please run the following commands and let me know the result:   echo %PATH% echo $PATH npm ls -g – Marion Jul 27 '18 at 12:28
  • C:\Program Files\OpenSSH\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Google\Chrome\Application;C:\Program Files (x86)\Mozilla Firefox;C:\tmp\webdriver;C:\tmp\webdriver\geckodriver;C:\Program Files\OpenSSH\bin;C:\Users\user\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\nodejs;C:\Program Files\Git\cmd echo $PATH npm ls -g – A R Jul 27 '18 at 15:52

1 Answers1

2

It looks like "C:\Users\user\AppData\Roaming\npm" is absent in PATH. This may happen if you installed node.js via an official installer and then via nvm. The installer configures "AppData\Roaming\npm" as a global folder for modules, and the nvm installer - "C:\Program Files\nodejs". Both installers set the global folder settings to PATH. So, the official installer config might leave in PATH after deleting the installer and is used by the nvm version.

To check this scenario, run the following command:

npm config get prefix 

If the command returns "AppData\Roaming\npm", change the letter to "Program Files\nodejs" using the following command:

 npm config set prefix "C:\Program Files\nodejs"

 

Marion
  • 1,074
  • 5
  • 10