Module not found error when trying to install browsers (v1.42.0)
johnboygit opened this issue · comments
Version
1.42.0
Steps to reproduce
- Upgrade project to 1.42.0
- Clean solution
- Rebuild
- run ./playwright.ps1 install from powershell
Expected behavior
browsers should install
Actual behavior
error is thrown:
.playwright\package\lib\cli\cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Additional context
No response
Environment
- Operating System: Windows 10
- CPU: [Intel]
- .NET Version (TFM): [net6.0]
Have you tried deleting the bin/ folder? Might be similar to #2069.
just tried but it hasn't made any difference
The issue you are observing is that there is an v1.41 (old) assembly trying to interact with a recent v1.42 Playwright driver.
Could you try deleting the obj folder as well? Do you maybe depend on multiple Playwright versions in your suite?
unfortunately that hasn't helped either.
I have a solution with two projects in it.
one project is a common one that has the playwright.net NuGet package. I build and publish a NuGet package from this to be consumed by any other test project in our organisation.
the other project in my solution is a simple test project that references the common project directly just to verify things are happy before I push and build the common one. this test project does not consume the playwright.net NuGet directly.
maybe this problem is only evident when a test project consumes playwright in this manner.
Update:
even if I run the browser install command from the output folder of the common project I get the same error so I don't think it has anything to do with one project referencing another
Would it be possible to share a reproduction with us which we can run locally? Otherwise we are unfortunately not able to act on it, thanks for your understanding.
Please try with the attached solution
I unfortunately was not able to reproduce, deleted obj/bin directory in both of the directories.
thanks. It seems to be working for me if I run powershell as admin so I'll close this issue.
I don't know why I didn't think of that before. I don't recall having to do it on previous upgrades.