Skip to content

Installation on Windows with npm #1784

@SamuelTilly

Description

@SamuelTilly

Summary

When installing prek with npm the binary is not extracted properly on Windows. I believe the PowerShell command is not working as intended in binary-install.js. Windows should have support for extracting the zip file with tar similar to Linux:

spawnSync("tar", ["-xf", tempFile, "-C", this.installDirectory]);

Willing to submit a PR?

  • Yes — I’m willing to open a PR to fix this.

Platform

Windows 11 x86_64

Version

0.3.5

.pre-commit-config.yaml

not applicable

Log file

$ npm exec prek

Error: spawnSync ...\node_modules\@j178\prek\node_modules\.bin_real\prek.exe ENOENT
    at Object.spawnSync (node:internal/child_process:1120:20)
    at spawnSync (node:child_process:911:24)
    at ...\node_modules\@j178\prek\binary-install.js:197:24
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawnSync ...\\node_modules\\@j178\\prek\\node_modules\\.bin_real\\prek.exe',
  path: '...\\node_modules\\@j178\\prek\\node_modules\\.bin_real\\prek.exe',
  spawnargs: [ 'install' ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions