Create-plugin throws "Unsupported operating system 'Windows' detected"

I wanted to get into the custom plugin development. I installed Grafana localy, enabled development mode, installed necessary dependencies and ran the command:

npx @grafana/create-plugin@latest

Which resulted in error:
Unsupported operating system 'Windows' detected. Please use WSL with create-plugin.

Screenshot of error:

What can I do to develop custom plugins for Grafana on windows 11 machine?

Okay now I have followed the blog about setting up a WSL for Grafana development.

I have installed on the WSL all the necessary libraries - but the error stays the same.

Please share how you access your wsl environment. A screen shot

@szlaurjakub Native windows is not supported. You should use WSL in windows.

Please keep in mind installing WSL (e.g. Ubuntu) in windows is not enough. You need to use the terminal provided by WSL and not windows cmd or powershell.

To install WSL follow the microsoft installation steps Install WSL | Microsoft Learn

A simple way to check you are running WSL is to install “ubuntu” in windows and then run “ubuntu”. This will likely open a WSL terminal.

1 Like

Hi @academo , I followed the instructions you provided, still saw the same issue. Don’t know where I missed:

In the screenshot the command I ran is not visible so here it is: npx @grafana/create-plugin@latest migrate

For me, after installing the WSL it asks for a restart.
Post your restart, it will open a CMD like terminal asking to setup your username and password for Ubuntu.
After setting it up u can continue on your task.
Another way is to: search for WSL in your windows search bar

1 Like

Hi @draegog we put together a troubleshoot guide that includes WSL Troubleshooting | Grafana Plugin Tools

I’m almost sure you are running the npx windows binary from inside linux. so even if you are inside WSL you are still running windows versions so check this part of the guide Troubleshooting | Grafana Plugin Tools

Wsl is very clunky. If you are stuck try virtualbox or some other hyoervisor like qijdows hyper v

Thanks @academo , the troubleshooting does the job :smiley:.
Sadly, I got this after already trying out all the options.
But anyhow I was able to migrate the plugin and build is also successful.

hi @academo , I am seeing this error after trying to configure the plugin:
Fetch error: 404 Not Found Instantiating http://localhost:3000/public/plugins/itom-opticdl-datasource/module.js Loading plugins/itom-opticdl-datasource/module

In the build I don’t see the module.js file
Commands I used to build the plugin:
yarn run build
mage -v

@draegog try this from our troubleshoot guide Troubleshooting | Grafana Plugin Tools