-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module 'vscode' – where is vscode.d.ts now installed? #2810
Comments
@jedmao you need to run a "npm install" after those changes so that the vscode.d.ts is fetched. The location of this file actually did not change, it should still be within node_modules/vscode/vscode.d.ts |
@bpasero one step ahead of you. Not only did I run "typings": "vscode.d.ts", The closest thing I could find was a file at |
@bpasero I also did an @alexandrudima, do you know more about this? I'm looking at https://github.com/Microsoft/vscode-editorconfig/blob/master/typings/vscode-typings.d.ts with your name on it. |
@jedmao there was a bug that prevented the vscode.d.ts file to be installed. When you run npm install please verify you see output like this:
|
Wanted to try and reproduce the problem here just for fun, so I uninstalled vscode from one of my existing, and perfectly functioning extensions, then followed the instructions listed on that page and updated the So I ran Looked at the install script, figured that NPM package vars weren't set for some reason, then added this script to my package.json: Using |
@bpasero I definitely don't see the output you pasted above. I even tried changing my engine from Then, I tried changing my Is there always going to be an engine version consistent with the version displayed in Lastly, you said there "was" a bug. That gave me more qeustions:
|
The Also, here's the issue that was fixed in 0.11.1: microsoft/vscode-extension-vscode#10 Have you tried running vscode's install script from your package.json though? |
@mattacosta I'm aware that I didn't run vscode's install script from package.json, because I'm not interested in that solution. I'm interested in solutions that don't require adding instructions to my README and work out-of-the-box for future contributors. Now, if you're suggesting I make it a post install script, that might be doable, but the release notes and guides don't say anything about this and I'd prefer to follow the golden path. That said, I'm going to attempt using the post install script until this project evolves. Thanks for the link to the issue! |
Sorry, I realised that I did not mention the necessary postinstall script. I updated the new & noteworthy. Any extension consuming the VS Code npm module 0.11.x needs to add the following to the package.json:
|
It works!
Still, I think others could well benefit from this in the release notes, right where it mentions the |
Why don't you add vscode.d.ts to DefinitelyTyped? |
Because it does not support versioning... |
The postinstall script in the client package is because of: microsoft/vscode#2810 (comment) Package locks added as Node needed updating to get them. Tsconfig changed in attempted troubleshooting step until I found microsoft/vscode#2810
The January Release Notes – Extension Authoring section says I should be able to update my
package.json
file to include the following:It also notes the following:
vscode.d.ts
is no longer shipping within thevscode
npm module.engine
field in your extension is used to determine which version ofvscode.d.ts
to use.It does not, however, tell me where
vscode.d.ts
is installed. I used to be able to do imports like:However, now I'm getting an error:
It's not clear to me, the new way to do these imports and I've tried tracking down
vscode.d.ts
to no avail, so I'm at a loss.The text was updated successfully, but these errors were encountered: