Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Support running on Windows #21

@gabritto

Description

@gabritto

We should support running dts-critic on Windows. So far dts-critic v3 was not tested on Windows, and the child_process command execution calls (like execFileSync and spawnSync) don't work. For example, running dts-critic on Windows for webpack gives the following error:

C:\Users\t-gaar\Desktop\DefinitelyTyped\dts-critic>node dist/index --dts=../DefinitelyTyped/types/webpack/index.d.ts --debug
C:\Users\t-gaar\Desktop\DefinitelyTyped\dts-critic\dist\index.js:153
    if (info.error !== undefined) {
             ^

TypeError: Cannot read property 'error' of null
    at getNpmInfo (C:\Users\t-gaar\Desktop\DefinitelyTyped\dts-critic\dist\index.js:153:14)
    at dtsCritic (C:\Users\t-gaar\Desktop\DefinitelyTyped\dts-critic\dist\index.js:63:21)
    at main (C:\Users\t-gaar\Desktop\DefinitelyTyped\dts-critic\dist\index.js:138:20)
    at Object.<anonymous> (C:\Users\t-gaar\Desktop\DefinitelyTyped\dts-critic\dist\index.js:832:5)
�[90m    at Module._compile (internal/modules/cjs/loader.js:959:30)�[39m
�[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)�[39m
�[90m    at Module.load (internal/modules/cjs/loader.js:815:32)�[39m
�[90m    at Function.Module._load (internal/modules/cjs/loader.js:727:14)�[39m
�[90m    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)�[39m
�[90m    at internal/main/run_main_module.js:17:11�[39m

This happens because this call to spawnSync fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions