abi / screenshot-to-code

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
https://screenshottocode.com
MIT License
54.66k stars 6.66k forks source link

An error message appears when running the front-end command yarn. How can I solve this problem? #346

Open ganganngannn opened 1 month ago

ganganngannn commented 1 month ago
(base) PS D:\code\screenshot-to-code-main\frontend> yarn
yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning vscode-languageclient@7.0.0: The engine "vscode" appears to be invalid.
[4/5] Linking dependencies...
warning "react-hot-toast > goober@2.1.13" has unmet peer dependency "csstype@^3.0.10".
warning " > thememirror@2.0.1" has unmet peer dependency "@codemirror/language@^6.0.0".
warning " > thememirror@2.0.1" has unmet peer dependency "@codemirror/state@^6.0.0".
warning " > thememirror@2.0.1" has unmet peer dependency "@codemirror/view@^6.0.0".
[5/5] Building fresh packages...
[-/5] ⠠ waiting...
[2/5] ⠠ puppeteer
[3/5] ⠠ puppeteer
[-/5] ⠐ waiting...
error D:\code\screenshot-to-code-main\frontend\node_modules\puppeteer: Command failed.
Exit code: 1
Command: node install.mjs
Arguments:
Directory: D:\code\screenshot-to-code-main\frontend\node_modules\puppeteer
Output:
Error: ERROR: Failed to set up Chrome v123.0.6312.122! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
    at file:///D:/code/screenshot-to-code-main/frontend/node_modules/puppeteer/lib/esm/puppeteer/node/install.js:58:23
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async downloadBrowser (file:///D:/code/screenshot-to-code-main/frontend/node_modules/puppeteer/lib/esm/puppeteer/node/install.js:90:9) {
  [cause]: Error: read ECONNRESET
      at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
    errno: -4077,
    code: 'ECONNRESET',
abi commented 1 month ago

I'll have to fix this issue.

But as the logs indicate, can you set PUPPETEER_SKIP_DOWNLOAD=True yarn? Puppeteer is only needed for development of this project, not for simplify using it so you can remove it safely.

ganganngannn commented 1 month ago

I'll have to fix this issue.

But as the logs indicate, can you set PUPPETEER_SKIP_DOWNLOAD=True yarn? Puppeteer is only needed for development of this project, not for simplify using it so you can remove it safely.

Thanks for your reply, I run $env:PUPPETEER_SKIP_DOWNLOAD="true" in PowerShell and the problem was solved.