mdn / mdn/browser-compat-data

generate-types.ts installation fails

Open
#27,307 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

info needed
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

What type of issue is this?

Other

What is the issue?

When I fetch the latest head revision of main, there is an error in the install phase. This is on Windows 11 in command prompt.

⠏ waiting: installnpm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'D:\\github\\mozilla\\browser-compat-data\\node_modules\\.lefthook-windows-x64-vIEOaVyO',
npm warn cleanup     [Error: EPERM: operation not permitted, unlink 'D:\github\mozilla\browser-compat-data\node_modules\.lefthook-windows-x64-vIEOaVyO\bin\lefthook.exe'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'unlink',
npm warn cleanup       path: 'D:\\github\\mozilla\\browser-compat-data\\node_modules\\.lefthook-windows-x64-vIEOaVyO\\bin\\lefthook.exe'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
⠋ waiting: gentypesnode:internal/child_process:1120
    result.error = new ErrnoException(result.error, 'spawnSync ' + options.file);
                   ^

Error: spawnSync tsc ENOENT
    at Object.spawnSync (node:internal/child_process:1120:20)
    at spawnSync (node:child_process:869:24)
    at default (D:\github\mozilla\browser-compat-data\utils\spawn.ts:18:18)
    at compile (D:\github\mozilla\browser-compat-data\scripts\generate-types.ts:173:3)
    at async <anonymous> (D:\github\mozilla\browser-compat-data\scripts\generate-types.ts:180:3) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawnSync tsc',
  path: 'tsc',
  spawnargs: [ '--skipLibCheck', '../types/types.d.ts' ]
}

Node.js v22.17.0

> @mdn/browser-compat-data@6.0.32 gentypes
> tsx scripts/generate-types.ts


summary: (done in 58.16 seconds)
✔️ install (31.33 seconds)
🥊 gentypes (26.06 seconds)
What behavior were you expecting?

Installation to succeed.

What version(s) of BCD is the issue present in?
  • The current BCD release
  • The current version of the main branch
Do you have anything more you want to share?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows command-prompt install failure, then start in scripts/generate-types.ts around compile at line 173 and utils/spawn.ts at line 18. Check how the gentypes entry invokes tsc and determine what prevents it from being found; done means installation completes successfully without the spawnSync tsc ENOENT error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.