'vscode.d.ts could not be installed

when I tried to run vscode-install, it would fail to sync vscode.d.ts. The problem seems random, most of our machines could not success, but two of our machines could success.
The error information is as follows:

Detected VS Code engine version: ^1.23.0
Error installing vscode.d.ts: Error: read ECONNRESET
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `vscode-install && node ./node_modules/vscode/bin/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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!     C:\Users\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_624Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `cd extension && npm install && cd ..`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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!     C:\Users\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_805Z-debug.log


Solution 1:[1]

I had a similar problem, where the VSCode engine in package.json was very old (1.32.0) compared to the current VSCode version (1.64.2). I just updated the engine to the same as my VSCode version in package.json:

    "engines": {
        "vscode": "^1.64.2"
    },

and the tests runner proceeds instead of erroring as before.

Unfortunately, I then got another error:

Error: Running extension tests from the command line is currently only supported if no other instance of Code is running.

which is a different problem and a limitation of VSCode at the moment (1.64.2), though there is a workaround for that.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 drkvogel