-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]Error: Cannot find module '@playwright/test' Playwright Version 1.33.0 #23098
Comments
@carolinapanther1 It looks like your have |
I'm having this exact issue upon installing version
I've tried to follow the steps listed above. My tests were running normally before upgrading to version |
@john-cyndx You probably have |
I still have the same issue , I am still stuck, I have deleted node js, reinstalled playwright in various ways, to be honest the playwright dev install steps documentation is not very clear to me, should I just try to install a older version to maybe solve this issue? |
Could you find a solution for this issue?? |
Same problem here, using yarn, in a project having both |
Idk why but when I've added EDIT: |
Removing the "playwright" package does in fact resolve this for me in v1.34, the problem I have is I need to use the chromium module from "playwright" |
@KunalOjha Yes, |
I resolved this issue by taking the following steps:
I am truly grateful for the assistance provided by everyone throughout this debugging process |
See microsoft/playwright#23098. Co-authored-by: Stephen Mathieson <me@stephenmathieson.com>
Why I don't need both? We have two projects in monorepo, one is using playwright for their own purposes, and I as QA use @playwright/test for testing? |
See my comment here for a fix if you need to have both installed: #6981 (comment) |
Hello All, I have experienced the same issue and fixed using below solutions. Got below error while trying to run playwright scripts in docker :
Solution : Step 1: Remove all the existing docker images which are related to the current project/playwright using the command "docker rmi IMAGE NAME or IMAGE ID" / "docker rmi -f IMAGE NAME or IMAGE ID" Step 2: Update from "WORKDIR /app" to "WORKDIR /root/app" in Dockerfile - This may be optional Step 3: Make sure "headless: true" in the playwright.config.ts Hope this helps. |
System info
Description:
I have been having issues with playwright and javascript for days, I have been deleting node js, visual studio code with all the extentions, after reinstalling it's the same error, I have the environment variables for node js also all set, and still, run constantly npm install, but still get the following error.
Test steps:
Error: Cannot find module '@playwright/test'
Require stack:
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Function.resolveFilename (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\common\transform.js:173:36)
at Function.Module._load (node:internal/modules/cjs/loader:920:27)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object. (C:\Users\andre\OneDrive\Documentos\PlaywrightTest\playwright.config.js:1:35)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module.f._compile (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\utilsBundleImpl.js:16:994)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Object.i..ot._extensions. (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\utilsBundleImpl.js:16:1010)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Function.Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at requireOrImport (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\common\transform.js:154:20)
at requireOrImportDefaultObject (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\common\configLoader.js:78:53)
at ConfigLoader.loadConfigFile (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\common\configLoader.js:54:26)
at runTests (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\cli.js:126:55)
at ji. (C:\Users\andre\AppData\Roaming\npm\node_modules@playwright\test\lib\cli.js:48:7) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\andre\OneDrive\Documentos\PlaywrightTest\playwright.config.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\lib\common\transform.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\lib\common\testType.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\lib\common\test.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\lib\reporters\multiplexer.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\lib\runner\reporters.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\lib\runner\runner.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\lib\cli.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\node_modules\playwright-core\lib\cli\cli.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\node_modules\playwright-core\cli.js',
'C:\Users\andre\AppData\Roaming\npm\node_modules\@playwright\test\cli.js'
]
}
// playwright.config.js
package.json
{
"name": "playwrighttest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC"
}
I have tryed a lot of different ways but the issue is that I can't proceed and will have that error I showed no matter how many I try to reproduce different steps to approach to this issue, if anyone has a suggestion or solution I'll be happy to hear it
The text was updated successfully, but these errors were encountered: