Xiang Yan
Xiang Yan

Reputation: 212

Activating extension `ms-vscode.wordcount` failed: Cannot find module 'd:/VSCode/vscode-wordcount/out/extension'

I try to build and debug an extension in Code.

I downloaded the sample of word-count from https://github.com/microsoft/vscode-wordcount.

When I clicked F5, ./out folder was not generated and I saw failure: Activating extension ms-vscode.wordcount failed: Cannot find module 'd:/VSCode/vscode-wordcount/out/extension'.

I found the post https://github.com/Microsoft/vscode-go/issues/35 and I think this was because I failed to build the extension.

And I checked my path that node and npm were both set.

I found there were 2 possible issues.

  1. I could not find .\node_modules folder in my extension folder. The folder structure is like

.vscode\

-- launch.json

-- settings.json

-- tasks.json

image\

test\

typings\

-- vscode-typings.d.ts

extension.ts

package.json

tsconfig.json

  1. My node version is v0.12.2.

Could you give me some hints how to investigate the issue?

Upvotes: 3

Views: 1720

Answers (1)

Avin Zarlez
Avin Zarlez

Reputation: 1682

You probably downloaded directly from GitHub.

You will need to run npm install in your project's folder in order to create the node_modules directory and add the required dependencies.

If you simply want to install the extension to use it, you will also need to:

  • Move the folder to the correct place
  • npm install

OR

  • Install the built version directly from the Visual Studio Marketplace through the command pallet.

Upvotes: 4

Related Questions