When compiling VSCode extension then typescript persistently complained
error TS2307: Cannot find module \'vscode\'.
Installation <
Run npm install
will fix the issue.
Because there is "post install" script (node ./node_modules/vscode/bin/install
) which fetch a vscode.d.ts according to the engine you're using in your project.
Detected VS Code engine version: ^1.6.0 Found minimal version that qualifies engine range: 1.6.0 Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/e52fb0bc87e6f5c8f144e172639891d8d8c9aa55/src/vs/vscode.d.ts vscode.d.ts successfully installed!
source