microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.17k stars 29.29k forks source link

extension node_modules not packaged properly #16368

Closed goessner closed 7 years ago

goessner commented 7 years ago

in short: After publishing and installing my extension 'Markdown+Math' I get

command 'extension.mdmath' not found

when trying to run it. Having a look at the extensions node_modules folder, I see only the three dependency folders

After doing a npm install from the command line in that extensions main directory the node_modules folder is populated with a lot more modules. The extension is working properly after that.

My package.json file has an

    "dependencies": {
        "markdown-it-katex": "^2.0.3"
    },

entry.

My question is: What am I doing wrong or what can I do, if I don't want to force my users doing an extra npm install from the command line.

I should mention, that I use the newest npm version 3.10.6 which generates a flat dependency folder structure now.

Steps to Reproduce: publishing and running extension ... Markdown+Math

  1. npm install ... installing all required node modules in dev subfolder ./node_modules
  2. vsce publish 0.8.8 ... publish extension to market place
  3. install extension 'Markdown+Math' from within VS Code ...
  4. Error when invoking extension grafik
  5. > cd %USERPROFILE%\.vscode\extensions\goessner.mdmath-0.8.8
  6. > npm install
  7. Ctrl+Shift+. invokes extension properly with any *.md file.

Thanks ....

goessner commented 7 years ago

I finally managed to resolve the problem. In the node_modules folder there were still a lot dependencies originating from vscode itself. After filtering those out, only a handful relevant were remaining, which I put into the dependencies list of package.json.

Everything is fine now ... please close this issue.