Closed 2BC-Wasabi closed 2 years ago
this fixed my issue, but i don't know if it is the correct way to do it, cmd in administrator mode
cd Install\Path npm init npm install testcafe npm install testcafe-browser-provider-electron npm install testcafe-react-selectors
testcafe "electron:." "test.e2e.ts" --dev
You can only import modules that are locally installed (except for built-in node.js modules such as fs
or events
). Global modules cannot be imported - this is a feature of node.js. The TestCafe module is an exception here (it is imported as built-in), but this only works when run with the testcafe
command from the command line. So, the way you work around this problem (installing npm packages locally) is correct.
i get this error even after i installed the packages globally, i'm using Electron React Boilerplate. and i'm trying to run the test after the app is installed
Cannot find module 'testcafe-react-selectors' or its corresponding type declarations.
tried to search for a fix but with no luck, here is my simple test.