Gary Ewan Park
Gary Ewan Park

Reputation: 18951

How to include all node_modules in vscode vsix package

I am running into an issue that is similar to this GitHub issue:

https://github.com/Microsoft/vscode/issues/23300

I have just published a new version of our Cake Extension for Visual Studio Code, and after installation, any attempt to run one of the commands that it contains, results in an error message that says (as an example):

command 'cake.bootstrapper' not found

Based on the GitHub issue linked above, if I go into the extension installation folder, and manually run:

npm install

The extension starts to work.

If I run the command:

vsce ls

I can see that some items are being added into the node_modules folder that is added to the vsix folder that is generated, but not all of them. I have confirmed that the node_modules folder are present in the source folder of my extension, but for some reason that they are not copied over.

I don't have anything other than the default in the .vscodegignore file.

The source code for the extension in question is here:

https://github.com/cake-build/cake-vscode

Can anyone provide any guidance on how to correctly package this extension, and all of it's dependencies?

Upvotes: 3

Views: 3826

Answers (1)

Gary Ewan Park
Gary Ewan Park

Reputation: 18951

Based on some feedback from one of our community members, we were able to figure out what the problem was. We were missing a depdendency in our package.json file, or, more specifically, the dependency was in the devDependencies section, rather than the dependencies section, which meant that it wasn't being pulled through into the generated vsix file.

The feedback that we received was on this GitHub issue:

https://github.com/cake-build/cake-vscode/issues/92

Upvotes: 2

Related Questions