Rayrun
ā† Back to Discord Forum

Node dependencies not being found after updating playwright from 1.37 to 1.38

ksamodulskiposted in #help-playwright
Open in Discord

Error: Cannot find module '....\clients\node_modules@types\fs-extra'

Hi!, has anyone had a similar issue? It seems like playwright starting from 1.38 doesn't see the dependencies inside it's own folder (in my case ...\clients\test\playwright) and starts to look in root.

The command I've used for updating was: '''npm install -D @playwright/test@latest'''

All works fine after switching back to 1.37.1 '''npm install -D @playwright/[email protected]'''

Please help, I'm stuck here!

This thread is trying to answer question "Why are Node dependencies not found after updating Playwright from version 1.37 to 1.38?"

9 replies

I went quickly through the changes, but couldnt find anything relevant.. https://github.com/microsoft/playwright/compare/release-1.37...release-1.38

You can try npm ls fs-extra to check if you've installed it correctly. Then try npm install fs-extra.

@apis3445 thanks for replying, npm ls fs-extra shows: "PS C:\DATA\git\g3-basics-demo-application\clients\test\playwright> npm ls fs-extra [email protected] C:...\clients\test\playwright ā””ā”€ā”€ [email protected]"

and running "npm install fs-extra" doesn't help either šŸ˜¦

Maybe it's somehow related to https://github.com/microsoft/playwright/issues/26614 ? - it's the only issue I see related to node dependencies between 1.37 and 1.38

(I'm using node 18.2.0)

Try npm i @types/fs-extra since only the types are missing. We don't depend on this package.

@mxschmitt thanks for your reply, tried it, but still no luck šŸ˜¦ Please also mind that:

  1. I have a package.json file both in ...\clients\ and ...\clients\test\playwright\ folders (the latter being for the pw tests)
  2. The only thing I'm doing is:
  • npm install -D @playwright/[email protected] -> it stops working (as in the image - node is looking for dependencies in the wrong folder upstream), then
  • npm install -D @playwright/[email protected] -> it works again ...
image.png

this is my "working" 1.37.1 package.json: `{ "name": "playwright", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "playwright": "npx playwright", "test": "npm run playwright test", "test:trace": "npm run test -- -- --trace=on & npm run test:report", "test:report": "npm run playwright show-report" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@playwright/test": "^1.37.1", "axios": "^1.2.1", "csv": "^6.1.0", "csv-parse": "^5.3.3" }, "dependencies": { "fs-extra": "^11.1.1", "lodash": "^4.17.21" } }

and this is the not working one, 1.38: { "name": "playwright", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "playwright": "npx playwright", "test": "npm run playwright test", "test:trace": "npm run test -- -- --trace=on & npm run test:report", "test:report": "npm run playwright show-report" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@playwright/test": "1.38", "axios": "^1.2.1", "csv": "^6.1.0", "csv-parse": "^5.3.3" }, "dependencies": { "fs-extra": "^11.1.1", "lodash": "^4.17.21" } } `

any ideas, anyone? šŸ˜¦

we solved it, finally, there was another tsconfig file in the project messing with import paths

good thanks for share the solution

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].