Comments (5)
Hey, the browsers which Playwright is using require special apt dependencies. Thats probably why the installation failed. On the upstream repo we have a working GitHub Codespaces configuration which uses the official Docker image as a base image:
https://github.com/microsoft/playwright/blob/master/.devcontainer/devcontainer.json
"image": "mcr.microsoft.com/playwright:next",
from playwright-cli.
Thanks @zeekrey and @mxschmitt. I can repro this issue with the Playwright image and I don't think it's related to the dependencies. When the global install failed, I tried installing it in a project which has a package.json (npm i playwright-cli
and then use npx (npx playwright-cli
)ย โย this worked. I think global NPM installs in Codespaces are behaving differently, and I've appended the error logs below.
Having said that, codegen inside a Codespace will not work at this stage, since it requires interacting with a headful browser window. CLI features that work with headless will work.
Full error log
1088 info lifecycle [email protected]~install: [email protected]
1089 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false
1090 verbose lifecycle [email protected]~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/.npm/_npx/590/lib/node_modules/playwright-cli/node_modules/playwright/node_modules/.bin:/root/.npm/_npx/590/lib/node_modules/playwright-cli/node_modules/.bin:/root/.npm/_npx/590/lib/node_modules/.bin:/root/workspace/try-playwright-codespaces/node_modules/.bin:/root/.vscode-remote/bin/076245b1ce18bc0c262bb287b3fcad1575d756ae/bin:/root/.vscode-remote/bin/076245b1ce18bc0c262bb287b3fcad1575d756ae/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
1091 verbose lifecycle [email protected]~install: CWD: /root/.npm/_npx/590/lib/node_modules/playwright-cli/node_modules/playwright
1092 silly lifecycle [email protected]~install: Args: [ '-c', 'node install.js' ]
1093 silly lifecycle [email protected]~install: Returned: code: 1 signal: null
1094 info lifecycle [email protected]~install: Failed to exec install script
1095 timing action:install Completed in 89ms
1096 verbose unlock done using /root/.npm/_locks/staging-c85135f3581f890b.lock for /root/.npm/_npx/590/lib/node_modules/.staging
1097 timing stage:rollbackFailedOptional Completed in 118ms
1098 timing stage:runTopLevelLifecycles Completed in 1797ms
1099 verbose stack Error: [email protected] install: `node install.js`
1099 verbose stack Exit status 1
1099 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
1099 verbose stack at EventEmitter.emit (events.js:315:20)
1099 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
1099 verbose stack at ChildProcess.emit (events.js:315:20)
1099 verbose stack at maybeClose (internal/child_process.js:1021:16)
1099 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
1100 verbose pkgid [email protected]
1101 verbose cwd /root/workspace/try-playwright-codespaces
1102 verbose Linux 5.4.0-1031-azure
1103 verbose argv "/usr/bin/node" "/usr/lib/node_modules/npm/bin/npm-cli.js" "install" "playwright-cli@latest" "--global" "--prefix" "/root/.npm/_npx/590" "--loglevel" "error" "--json"
1104 verbose node v12.18.4
1105 verbose npm v6.14.6
1106 error code ELIFECYCLE
1107 error errno 1
1108 error [email protected] install: `node install.js`
from playwright-cli.
I am not sure how this is supposed to work - npx playwright-cli codegen
will run you on your GH codespace box. Do you have a VNC or Remote Desktop pointing at it?
from playwright-cli.
Was able to reproduce this issue using Docker node:14
and inside npx playwright-cli
which should at least show the help but it results in:
root@5a42fa3ab00f:/# npx playwright-cli
/usr/local/lib/node_modules/npm/node_modules/libnpx/index.js
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '/root/.npm/_npx/552/lib/node_modules/playwright-cli/node_modules/playwright/install.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-14T16_02_11_855Z-debug.log
Install for [ 'playwright-cli@latest' ] failed with code 1
root@5a42fa3ab00f:/#
Tried to dig a bit into it, but didn't found directly something which could cause it.
from playwright-cli.
Closing as per my comment above, please feel free to open a new one with additional details if this is still a problem!
from playwright-cli.
Related Issues (20)
- Ability to execute helper methods to change page state during codegen HOT 1
- [Bug] Page fill is adding extra line breaks HOT 1
- Add flag and environment variable to specify executablePath(s) for lightweight Alpine Linux container HOT 5
- Download button from webpage clicked but download was not executed or download event didn't happen HOT 3
- [Regression] Hovering on elements shows a stretched screenshot as overlay
- [BUG] playwright-cli does not work with NPX on Node.js 14 and 12 HOT 1
- 'npx playwright-cli open example.com' failed HOT 2
- Error running codegen
- [Bug] WebKit/iPhone viewport size on Windows HOT 2
- Codegen generates wrong selector for a box uncheck
- [Request] Allow installation of playwright-cli with single browser packages (playwright-chromium, ...) HOT 2
- Need help to handle Iframe HOT 1
- Feat: introduce --save-state and --load-state options HOT 1
- [BUG] Codegen closes after newpage in browser HOT 2
- Codegen behaves inconsistently across browsers HOT 1
- Chromium element selection broken HOT 5
- How to set ignoreHTTPSErrors on the underlying browser context? HOT 1
- How to set ignoreHTTPSErrors on the underlying browser context? HOT 2
- Feature Request: Record network requests and save them as ready-to-use mocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright-cli.