mistermist
mistermist

Reputation: 123

Error: "extension/package.json not found inside zip." when repackaging and installing VSIX

I've downloaded a VSIX extension for VSCode here:

https://marketplace.visualstudio.com/items?itemName=mblode.twig-language-2

I've then tested this VSIX in VSCode and it installs, no problem.

At this point I then uninstall, rename the VSIX to a zip and then unzip to make edits.

The only edit I'm making is adding Indent rules in the Language config.

I then rezip (using macOS Finder) and rename to a VSIX file extension.

Upon trying to install again in VSCode I get the error "extension/package.json not found inside zip."

There is one at that path so I'm uncertain what the issue is.

Help appreciated.

Upvotes: 3

Views: 13647

Answers (1)

Gama11
Gama11

Reputation: 34128

I think chances are that the repackaged .zip does not have the correct format. If you use the offical vsce tool for this instead, the .vsix you end up with should definitely be valid.

First install it (requires NPM to be installed) with:

npm install -g vsce

Then you should be able to just switch to the directory where you've installed the extension (~/.vscode/extensions/<name>) and run:

vsce package

Upvotes: 2

Related Questions