VSCode extension works in development but fails when installed

Viewed 547

I created an extension for adding test files in Ruby on Rails - https://github.com/SimonBo/rails-go-to-test. It works when I test it locally (press F5 from VSCode with the extension code open) but when I package the extension and install it i get => "command 'extension.goToTest' not found". The problem is probably with runtime dependencies but not sure how to fix this.

2 Answers

It might be that the version of VSCode you have on your computer is older than the version specified in your package.json.

    "engines": {
        "vscode": "^1.45.0"
    },

If you're certain that your extension will work with an older version like "^1.32.0" , update the engines key in your package.json as well as the version of @types/vscode, etc. in your devDependencies.

If this doesn't work, make sure that all the paths in your package.json are specified correctly.

Turns out I was using mkdirp but it wasnt specified in dependencies in package.json, adding the following line fixed everything:

"dependencies": {
    "mkdirp": "^0.5.1"
  }
Related