GithubHelp home page GithubHelp logo

Comments (5)

mxschmitt avatar mxschmitt commented on June 8, 2024

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.

arjunattam avatar arjunattam commented on June 8, 2024

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.

pavelfeldman avatar pavelfeldman commented on June 8, 2024

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.

mxschmitt avatar mxschmitt commented on June 8, 2024

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.

pavelfeldman avatar pavelfeldman commented on June 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.