I tried to make my own extension for Visual Studio Code and ran in some issue.
I did everything like in the guide from https://code.visualstudio.com/api/get-started/your-first-extension.
My vsce version is 2.16.0, my npm version is 9.2.0
First I ran
yo code
and generated an extension with the name "test". Then I ran
cd test
vsce package
and expected a file called something like test.vsix
but got the following error:
ERROR Extension entrypoint(s) missing. Make sure these files exist and aren't ignored by '.vscodeignore':
extension/dist/extension.js
The file mentioned in the error message (.vscodeignore
):
.vscode/**
.vscode-test/**
out/**
node_modules/**
src/**
.gitignore
.yarnrc
webpack.config.js
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
But even if I empty this file there is still the same error. Why? What did I forget?
3
Answers
I have no idea why, but it seems like the default npm and node versions on Linux just don't work correctly in that case. Like in ERROR Extension entrypoint(s) missing while I'm trying to package a developed vscode extension with vsce
I completely uninstalled node and npm from my system, even deleted the
npm
directory from my globalnode_modules
and then followed the guide on https://github.com/nodesource/distributions#using-ubuntu to reinstall everything.Now it suddenly works...
I ran into similar trouble.
vsce package
(latest version, v2.15.0) was warning about unnecessary files being included:esbuild
but it gave warnings about one of my included packages which I could not solve (import * as FormData from 'form-data';
)
.vsix
or Marketplace..vscodeignore
changes, here. Seems like I neednode_modules
and (probably)webpack.config.js
files.my problem is in my package.json
"main": "./out/extension.js"
is incorrect, should be"main": "./dist/extension.js"