1

I'm trying to create a custom Force Directed Graph using the source code on Github (PowerBI-visuals-ForceGraph) and following the tutorial available at creating-a-custom-visual. Unfortunately, when I try to start the custom visual using the "pbiviz start" command in PowershellI I get an error stating "Invalid API version v2.3.0".

The "circlecard" example project used in the tutorial, which also uses API version v2.3.0 in it's pbiviz.json file, works just fine. So I'm clueless as to what's causing this error. I'm very new to trying out custom visuals on Power BI so any help with this is greatly appreciated.

Thanks in advance!

Chipmunk_da
  • 467
  • 2
  • 9
  • 27
  • 1
    Try `pbiviz update` and `pbiviz start` again – Ulug Toprak Jan 04 '19 at 11:04
  • Thanks @UlugToprak. That error has gone away now. However, I get another one `PS C:\Users\VAsher\forceGraph> pbiviz start info Building visual... error VALIDATION The PowerBI-visuals.d.ts in your tsconfig.json must match the api version in pbiviz.json (expected: .api/v2.3.0/PowerBI-visuals.d.ts)` – Chipmunk_da Jan 04 '19 at 11:42
  • I tried searching for file PowerBI-visuals.d.ts but it doesn't seem to exist.. – Chipmunk_da Jan 04 '19 at 11:43
  • Did you use the `pbiviz update` that time or `npm run start` as suggested by the other answer? – Ulug Toprak Jan 04 '19 at 11:45
  • I used `npm run start` first and that threw an error. Later when I saw your reply I used `pbiviz update` and `pbiviz start`. Would that have caused this new error? :( – Chipmunk_da Jan 04 '19 at 11:49
  • Not necessarily, I think `pbiviz start` command is using a different version then what you installed in your project folder locally. try installing the powerbi-visuals-tools@beta globally – Ulug Toprak Jan 04 '19 at 11:53
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/186188/discussion-between-v-asher-and-ulug-toprak). – Chipmunk_da Jan 04 '19 at 11:55

2 Answers2

4

Try npm install and then npm run start, that should work :)

MiLo
  • 126
  • 2
  • 8
  • Thanks @MiLo. I tried as you suggested but now it throws a different error – Chipmunk_da Jan 04 '19 at 11:34
  • npm ERR! Failed at the powerbi-visuals-forcegraph@2.0.2 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm WARN Local package.json exists, but node_modules missing, did you mean to install? – Chipmunk_da Jan 04 '19 at 11:37
  • first do **npm instal**l and then **npm run start**, my bad :) – MiLo Jan 04 '19 at 13:06
  • Thanks, tried that as well. But it throws the error ` The PowerBI-visuals.d.ts in your tsconfig.json must match the api version in pbiviz.json (expected: .api/v2.3.0/PowerBI-visuals.d.ts)` – Chipmunk_da Jan 04 '19 at 13:36
  • [link](https://github.com/Microsoft/PowerBI-visuals-tools/issues/242) seems to have a similar issue and suggests installing powerbi-visuals-tools@beta. But that didn't seem to work for me.. – Chipmunk_da Jan 04 '19 at 13:42
  • I would suggest to redownload the repository from github. I just did that and it worked. If that doesn't work I would suggest to send an email to pbicvsupport@microsoft.com. I have contacted them many times before and they always helped me out very fast :) – MiLo Jan 04 '19 at 14:32
0

PowerBI-visuals-ForceGraph visual was converted to use the new version of powerbi-visuals-tools@beta

If you installed the tools as global by command:

npm i powerbi-visuals-tools --global

and run pbiviz start from global instance it will not work, because old tools doesn't support a new format of visual project.

npm run start - start powerbi-visuals-tools from local instance

specified in package.json of the visual: https://github.com/Microsoft/PowerBI-visuals-ForceGraph/blob/master/package.json#L71

You need to install beta version of tool as global or run npm run start to use the new tools

  • What do you mean by "you need to install beta version of tool as global?" Would the command for that be npm i powerbi-visuals-tools@beta --global? – Chipmunk_da Jan 23 '19 at 16:54
  • Just execute `npm install --global powerbi-visuals-tools@beta` in terminal. And you can run `pbiviz start` or `pbiviz package` for PowerBI-visuals-ForceGraph – Ilfat Galiev Jan 23 '19 at 20:04