bahmutov / local-cypress

Use Cypress without global objects
https://glebbahmutov.com/blog/local-cypress/
33 stars 3 forks source link

VSCode Error: Cannot find module 'local-cypress' #38

Open cuixiping opened 3 years ago

cuixiping commented 3 years ago
import { cy } from "local-cypress"

I got an error in VSCode:

Cannot find module 'local-cypress'. Did you mean to set the 'moduleResolution' option to 'node', 
or to add aliases to the 'paths' option? ts(2792)

So I added "moduleResolution": "node" to tsconfig.json.

{
  "compilerOptions": {
    "moduleResolution": "node",
    ...
  },
  ...
}

I hope this configuration requirement to be mentioned in local-cypress documentation.

bahmutov commented 2 years ago

Hi @cuixiping do you mind opening a pull request with this update to the README file?