i want to install grafaana on my windows laptop, i have docker and influx 1.8 already installed and running
Assistant
Great! Since you already have Docker and InfluxDB 1.8 installed and running on your Windows laptop, installing Grafana using Docker is straightforward.
Here's a step-by-step guide to get Grafana up and running:
Step 1: Pull the Grafana Docker Image
Open your terminal (PowerShell, Command Prompt, or Docker CLI), and pull the official Grafana image:
bash
docker pull grafana/grafana
Step 2: Run the Grafana Container
Run the Grafana container with Docker, mapping the Grafana default port (3000) to your host machine:
bash
docker run -d -p 3000:3000 --name=grafana grafana/grafana
-d runs the container in detached mode.
-p 3000:3000 maps the container port 3000 to your local port 3000.
--name=grafana names your container "grafana".
Step 3: Access Grafana Web UI
Once the container is running, open your browser and navigate to:
code
http://localhost:3000
The default login is:
Username: admin
Password: admin
You will be prompted to change the password after the first login.
Step 4: Add InfluxDB 1.8 as a Data Source in Grafana
In Grafana, go to Configuration (gear icon) > Data Sources.
Click Add data source.
Select InfluxDB.
Configure the data source with the following:
URL: http://host.docker.internal:8086
(This allows the Grafana container to reach your InfluxDB running on the Windows host.)
Database: your InfluxDB database name.
User: your InfluxDB username (if set).
Password: your InfluxDB password (if set).
Choose InfluxQL as the query language.
Click Save & Test.
Notes
host.docker.internal is a special DNS name that resolves to the internal IP address used by the host. Docker containers can use it to connect back to the host services running on the Windows machine.
If you face connectivity issues, verify that InfluxDB is accessible from inside the container by running a temporary container and using tools like curl or telnet.
Example to test InfluxDB connectivity (replace as needed):
bash
docker run --rm appropriate/curl curl http://host.docker.internal:8086/ping
You should receive a 204 No Content response if InfluxDB is up.
If you want to persist Grafana data (dashboards, settings), consider mounting persistent storage:
bash
docker run -d -p 3000:3000 --name=grafana -v grafana-storage:/var/lib/grafana grafana/grafana
Let me know if you want me to help with creating dashboards or troubleshooting!
User
PS C:\WINDOWS> docker run -d -p 3000:3000 --name=grafana grafana/grafana
e35586ac5331788c930992b4a1a698ae1827023aac58762f9a1d23e76aa5804d
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3000 -> 127.0.0.1:0: listen tcp 0.0.0.0:3000: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Assistant
The error you're seeing:
code
Ports are not available: exposing port TCP 0.0.0.0:3000 -> 127.0.0.1:0: listen tcp 0.0.0.0:3000: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
indicates that port 3000 on your Windows machine is already in use or blocked, or Docker does not have permission to bind to it.
Here are some ways to troubleshoot and fix this:
1. Check if Port 3000 is Already in Use
Run this PowerShell command to see if port 3000 is taken:
powershell
netstat -aon | findstr :3000
If you see a line with LISTENING on port 3000, note the PID (process ID) at the end.
Then check which process is using it:
powershell
tasklist | findstr <PID>
If some app you didn't expect is using port 3000, you can either stop that app or run Grafana on a different port.
2. Run Grafana on a Different Port
Try using another port, e.g., 3001:
powershell
docker run -d -p 3001:3000 --name=grafana grafana/grafana
Then visit http://localhost:3001 in your browser.
3. Check Firewall or Network Restrictions
Windows firewall or security software might block Docker from binding to that port.
Temporarily disable firewall/security software to test.
Make sure Docker Desktop has admin permissions.
Run PowerShell or Command Prompt as Administrator.
4. Check for Conflicting Services or Apps
Apps like Skype, VPN clients, or other local servers often bind ports.
Quit those apps temporarily.
Try again.
5. Restart Docker and Your Computer
Sometimes Docker's networking stack can get into a bad state:
Restart Docker Desktop.
Reboot Windows if needed.
6. Remove Any Existing Grafana Containers
If you previously tried running Grafana and the container is stuck or port bindings conflicted:
powershell
docker rm -f grafana
Then try running again on a free port.
Summary
Try this one first:
powershell
docker run -d -p 3001:3000 --name=grafana grafana/grafana
Then open http://localhost:3001.
If you want, I can help you check what app uses port 3000 or help with further diagnostics!
User
PS C:\WINDOWS> docker run -d -p 3001:3000 --name=grafana grafana/grafana
docker: Error response from daemon: Conflict. The container name "/grafana" is already in use by container "e35586ac5331788c930992b4a1a698ae1827023aac58762f9a1d23e76aa5804d". You have to remove (or rename) that container to be able to reuse that name.
Run 'docker run --help' for more i
Assistant
The error message means there's already a container named grafana on your system, likely the one you started before that ran into the port issue.
Solution: Remove or Rename the Existing Container
You have two options:
Option 1: Remove the Existing Container
If you don't need the old container, remove it by running:
powershell
docker rm -f grafana
This forces removal of the container named grafana.
Then you can rerun:
powershell
docker run -d -p 3001:3000 --name=grafana grafana/grafana
Option 2: Use a Different Container Name
If you want to keep the existing container, start your new Grafana with a different container name:
powershell
docker run -d -p 3001:3000 --name=grafana2 grafana/grafana
Recommended Step to Clean Up
Since the old container is probably non-functional (because of the port problem), it’s best to remove it:
powershell
docker rm -f grafana
Then start fresh with:
powershell
docker run -d -p 3001:3000 --name=grafana grafana/grafana
If you want to see running and stopped containers, you can list them with:
powershell
docker ps -a
Let me know if you want help with any of these steps!
User
PS C:\WINDOWS> docker rm -f grafana
grafana
PS C:\WINDOWS> docker run -d -p 3001:3000 --name=grafana grafana/grafana
e2c6c8fcc2f9c370447142baa83b25f96fda2e4b8ae5be6e94276ff843c3ff68
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3001 -> 127.0.0.1:0: listen tcp 0.0.0.0:3001: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Assistant
The error again indicates that port 3001 is also unavailable or blocked for Docker to bind on your machine.
Since this is a Windows-specific socket permission error, here are a few additional troubleshooting steps:
1. Check which process is using port 3001
Run in PowerShell:
powershell
netstat -aon | findstr :3001
If the port is in use, note the PID and check the associated process:
powershell
tasklist | findstr <PID>
If a process is using that port, you can try stopping it or choosing an unused port instead.
2. Try a high-numbered port
Sometimes ports under 1024 or even under 5000 can be restricted by Windows or other software. Try a port higher than 50000, e.g., 50001:
powershell
docker run -d -p 50001:3000 --name=grafana grafana/grafana
Then visit http://localhost:50001
3. Run PowerShell as Administrator
Make sure your PowerShell or Command Prompt window has administrator privileges, as sometimes Docker needs elevated permissions to bind ports on Windows.
Right-click on PowerShell → Run as Administrator
Try your docker run command again.
4. Check if Windows Firewall or security software is blocking Docker
Some antivirus, firewall, or VPN software may block Docker from binding ports.
Try:
Temporarily disabling antivirus/firewall.
Whitelist Docker in your firewall rules.
5. Reset Docker's Network
Try resetting Docker Desktop's network settings:
Open Docker Desktop.
Go to Settings > Reset.
Click Reset to factory defaults (Warning: this removes all containers/images).
Or restart Docker Desktop altogether.
6. Check for Windows socket restrictions
Sometimes Windows has socket permission issues caused by reserved port ranges.
Check reserved ports with:
powershell
User
PS C:\WINDOWS> docker run -d -p 50001:3000 --name=grafana grafana/grafana
f04248aec442b4f8aee1c91800366ef39c7a20a85811b2da5912f71a91a58e7d
Assistant
Great! Your Grafana container started successfully on port 50001 without errors.
Next steps:
Open your web browser and go to:
code
http://localhost:50001
Log in with default credentials:
Username:admin
Password:admin
You'll be prompted to change your password on first login.
After login, you can configure InfluxDB as a data source (using http://host.docker.internal:8086 as URL if InfluxDB runs on your Windows host).
If you want to make sure the container is running, you can run:
powershell
docker ps
You should see the Grafana container listed and running.
Let me know if you want help setting up your InfluxDB data source in Grafana or building dashboards!
User
database name required error reading influxDB
Assistant
The "database name required" error from InfluxDB means that Grafana tried to query InfluxDB but didn’t specify which database to read from. InfluxDB 1.8 requires the database name to be set when making queries.
Here’s how to fix that in Grafana:
Step 1: Confirm your InfluxDB database name
If you don’t remember the database name you created in InfluxDB, you can check it by querying InfluxDB directly.
If InfluxDB is running locally, you can:
Open a terminal or PowerShell.
Run influx to enter the InfluxDB shell.
Then run:
sql
SHOW DATABASES;
This will list the available databases.
Step 2: Configure Grafana InfluxDB Data Source with the Database Name
In Grafana:
Go to Configuration (gear icon) > Data Sources.
Select your InfluxDB data source or add a new one.
Set the URL to:
code
http://host.docker.internal:8086
(if InfluxDB runs on your Windows host and Grafana is in Docker)
Set the Database field with the exact database name you found from Step 1.
Choose the correct Auth settings (username/password) if you have set them in InfluxDB.
Set Query Language to InfluxQL (not Flux).
Click Save & Test.
If successful, you should see a green confirmation.
Step 3: Check your queries
If you still see errors when creating panels, make sure:
Your queries specify the correct measurement and fields.
The database name is set properly (as above).
Additional info
Because you’re running InfluxDB 1.8, make sure the data source in Grafana uses InfluxQL, not Flux.
If you want, I can help you set up a sample dashboard or test queries—just let me know!
User
datasource is working. 1 measurements found
Assistant
Great! Since your datasource is working and Grafana found 1 measurement, that means you have successfully connected Grafana to your InfluxDB database.
Next steps:
Create a Dashboard and Panels:
In Grafana, click on + (Create) > Dashboard
Click Add new panel.
In Query section, select your InfluxDB data source.
Choose the measurement from the dropdown (the one detected).
Build your query using fields and tags as needed.
Adjust visualization type (Graph, Stat, Table, etc.).
Save your dashboard.
Basic Query Example:
If your measurement is called temperature, for example, try using:
code
SELECT mean("value") FROM "temperature" WHERE $timeFilter GROUP BY time($interval) fill(null)
Replace "value" with your actual field name.
Time Range:
Make sure the time picker (top right corner) is set correctly (e.g., Last 1 hour) to see data.
Troubleshooting:
No data showing? Check your data exists in InfluxDB for the selected time range.
Ensure timestamps are stored properly in InfluxDB.
Verify the measurement name and field names via InfluxDB CLI or API.
If you'd like, I can help write specific queries or build dashboards based on your data—just share your measurement and field names!
The @grafana/llm package you linked is a Grafana plugin (likely a frontend plugin) distributed via npm. To install a Grafana plugin like this in your running Grafana instance (especially the Docker container), you typically need to:
Download and install the plugin into Grafana's plugin directory.
Restart Grafana to load the plugin.
However, this particular package (@grafana/llm) is published on npm and is intended for frontend plugin development or bundling, not as a standalone installable plugin ZIP. It doesn't come pre-built for direct installation into Grafana via grafana-cli or plugin installation commands.
How to proceed with @grafana/llm in your Docker Grafana environment
Option A: Build the plugin from source and install
If you want to use the @grafana/llm plugin, you can:
Clone/download the plugin source (usually from its GitHub repo if available).
Build the plugin (which uses npm and webpack or another bundler).
Copy the built plugin files into the Grafana plugins folder.
Restart Grafana to load the plugin.
Option B: Use grafana-cli (if the plugin is published in Grafana's plugin repo)
The recommended way to install official or community plugins is:
bash
grafana-cli plugins install <plugin-id>
But since this plugin isn't currently listed in Grafana's official plugin repo or CLI, this won't work.
Option C: Mount a local plugin folder into your Grafana Docker container
Develop or build the plugin locally on your Windows machine.
Mount your plugin folder into the Grafana container's /var/lib/grafana/plugins directory when running Docker.
Example Docker run command with volume mount:
powershell
docker run -d -p 50001:3000 --name=grafana -v C:\path\to\your\plugin-folder:/var/lib/grafana/plugins grafana/grafana
Make sure the plugin is built and ready inside C:\path\to\your\plugin-folder.
Option D: Check if the plugin is already included or waiting for official release
Sometimes Grafana Labs publishes plugins with namespaced npm packages (e.g. ) but they require special installation or await inclusion in Grafana releases.
User
First, add the latest version of @grafana/llm to your dependencies in package.json:
{
"dependencies": {
"@grafana/llm": "0.22.0"
}
}
Assistant
Thanks for the snippet! It looks like you're working on developing or customizing a Grafana plugin or frontend app that uses @grafana/llm as an npm dependency rather than just installing it into a running Grafana server.
What you're doing:
Adding "@grafana/llm": "0.22.0" to your package.json dependencies means you want to use this LLM (Large Language Model) library in your own Grafana plugin or frontend app project.
How to proceed if you're developing a Grafana plugin or app using this library:
1. Create or have a plugin/app project with package.json:
If you don't have a project yet, you can start one:
bash
mkdir my-grafana-llm-plugin
cd my-grafana-llm-plugin
npm init -y
2. Add the dependency
Edit your package.json like you wrote:
json
{
"dependencies": {
"@grafana/llm": "0.22.0"
}
}
Or run:
bash
npm install @grafana/llm@0.22.0
3. Build your plugin/app
Use the Grafana plugin toolkit or your own build system.
Import and use features from @grafana/llm as needed.
Build the plugin bundle (npm run build or equivalent).
This reads package.json and downloads the @grafana/llm package into node_modules.
Alternative quick way to install via npm command:
Instead of creating package.json manually, you can just run:
powershell
npm init -y
npm install @grafana/llm@0.22.0
npm init -y creates a default package.json.
npm install @grafana/llm@0.22.0 adds the dependency and updates package.json automatically.
Summary
Don’t enter JSON directly into PowerShell prompt.
Use a text editor for JSON files.
Use npm commands to manage dependencies.
Let me know if you want help scaffolding the rest of your Grafana plugin project!
User
PS C:\WINDOWS\my-grafana-llm-plugin> npm init -y
npm install @grafana/llm@0.22.0
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:2 char:1
grafana-toolkit plugin:create my-llm-plugin
npm warn deprecated @grafana/toolkit@10.1.10: This package is no longer supported. Use @grafana/create-plugin instead.
This will launch an interactive setup to create a new plugin named my-llm-plugin.
After the plugin is created:
Go into the plugin directory:
powershell
cd my-llm-plugin
Add the @grafana/llm package as a dependency:
powershell
npm install @grafana/llm@0.22.0
Open the plugin source files (e.g., in VS Code) and start using the @grafana/llm library by importing it in your React components:
tsx
import { useLLM } from '@grafana/llm';
// your implementation here
Build your plugin:
powershell
npm run build
Run Grafana Docker with your plugin mounted
Run Grafana with your new plugin folder mounted to the plugins directory:
powershell
docker run -d -p 50001:3000 --name=grafana -v C:\WINDOWS\my-llm-plugin:/var/lib/grafana/plugins grafana/grafana
Finally:
Open your browser to http://localhost:50001
Your plugin should appear under the plugins section or where you’ve configured it.
Need help with example code using @grafana/llm or anything else? Just say the word!
User
PS C:\WINDOWS\my-grafana-llm-plugin> grafana create-plugin my-llm-plugin
grafana : The term 'grafana' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
If npm bin -g doesn't work, find global npm dir manually.
Try running the full path to the grafana-plugin executable.
If you want, I can help you check your npm version and update it step-by-step!
User
it's still not working, i get unknown command bib error, what does this means? Add the output folder from npm bin -g.
Assistant
The "unknown command bin" error from npm bin -g means your version of npm doesn't recognize bin as a command, which usually points to an older or broken npm installation.
What does npm bin -g do?
It tells you the directory where globally installed npm package executables (binaries) are placed.
On Windows, usually something like:
code
C:\Users\<YourUser>\AppData\Roaming\npm
This folder contains the scripts/commands installed globally (like grafana-plugin.cmd).
You need that folder in your system PATH so you can run such CLI commands from any terminal.
Because your npm doesn't support npm bin, here is how to fix:
Step 1: Check your npm and node versions
Run:
powershell
node -v
npm -v
If you don’t see version numbers or if npm version is below ~5.x (npm 5 was released in 2017), your npm is outdated.
Options:
-v, --version Toolkit version
-h, --help display help for command
Commands:
plugin:create [name] [removed] Use grafana create-plugin instead
plugin:build [options] [removed] Use grafana create-plugin instead
plugin:sign [options] [removed] Use grafana sign-plugin instead
Assistant
The key part of the message:
code
create-plugin@5.25.0 Unsupported operating system detected
Create plugin does not support Windows. Please use WSL.
Learn more about this error:
https://grafana.com/developers/plugin-tools/troubleshooting
Explanation
The current @grafana/create-plugin version you installed does not support native Windows directly.
It expects you to run it in a WSL (Windows Subsystem for Linux) environment on Windows.
This is because the plugin tools rely on Unix-like environment features not fully available in plain Windows PowerShell or CMD.
What are your options
Option 1: Use WSL (recommended)
Install WSL (Windows Subsystem for Linux), e.g., Ubuntu distro:
Open PowerShell as Administrator and run:
powershell
wsl --install
Once installed, launch your Linux shell (Ubuntu).
In the Linux shell, install Node.js & npm (e.g., via NodeSource or apt).
In WSL, install @grafana/create-plugin globally:
bash
npm install -g @grafana/create-plugin
Run the plugin create command in WSL:
bash
create-plugin my-llm-plugin
This is the officially recommended workflow for Grafana plugin development on Windows.
Option 2: Use a Linux VM or remote dev environment
If WSL isn’t an option, you can run Linux in a virtual machine or use a cloud/dev container environment like GitHub Codespaces.
Option 3: Try unofficial Windows workaround (not guaranteed)
Some users try to run the tools on Windows with workarounds (like Git Bash, Cygwin, or using legacy @grafana/toolkit) but these are now deprecated and may cause issues.
Summary
The official @grafana/create-plugin does not support Windows without WSL.
Install WSL (recommended).
Develop your plugin inside the Linux environment.
This ensures the toolkit runs smoothly.
If you want, I can guide you through the WSL installation and setup process so you can develop your Grafana plugin correctly on Windows!
21 packages are looking for funding
run npm fund for details
Assistant
Great! You successfully installed @grafana/create-plugin inside your WSL environment.
Next, scaffold your plugin project in WSL:
Run:
bash
create-plugin my-llm-plugin
This will start the interactive plugin creation process inside WSL.
After that:
Change directory into your plugin:
bash
cd my-llm-plugin
Add the LLM dependency:
bash
npm install @grafana/llm@0.22.0
Develop your plugin — you can edit these files with your Windows IDE (e.g., VS Code supports WSL seamlessly).
Build the plugin for Grafana:
bash
npm run build
To use the plugin with your Docker Grafana:
Either copy the plugin folder from WSL filesystem to your Windows host.
Or mount the WSL path directly into your Grafana Docker container.
Bonus: Using VS Code with WSL
If you use VS Code, install the Remote - WSL extension — it lets you edit Linux files comfortably and run commands from the VS Code terminal inside WSL.
If you want, I can help with sample code using @grafana/llm or guide you through building and running the plugin. Just ask!
User
/mnt/c/Users/sushilk/AppData/Roaming/npm/create-plugin: 15: exec: node: not found
Assistant
The error:
code
/mnt/c/Users/sushilk/AppData/Roaming/npm/create-plugin: 15: exec: node: not found
means that inside your WSL environment, the node command is not found — i.e., Node.js is not installed or not in your WSL PATH, so the create-plugin script (which requires node) can't run.
Why this happens
You installed Node.js on Windows, but WSL is a separate Linux environment.
The Windows-installed Node.js and npm aren't visible inside WSL.
You need to install Node.js inside WSL separately.
How to fix: Install Node.js inside WSL
Here's how to install Node.js (with npm) inside your WSL Ubuntu shell:
Step 1: Update package index
bash
sudo apt update
Step 2: Install Node.js and npm
You can install Node.js from Ubuntu repos but it's usually outdated, so better to use NodeSource's repo for up-to-date versions.
TypeError: command is not a function
at file:///mnt/c/Users/sushilk/AppData/Roaming/npm/node_modules/@grafana/create-plugin/dist/bin/run.js:27:1
at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Assistant
The error:
code
TypeError: command is not a function
at ...@grafana/create-plugin/dist/bin/run.js:27:1
is a known issue when running @grafana/create-plugin installed on Windows (/mnt/c/... path) inside WSL, due to incompatibilities between Windows path-mounted npm global installs and WSL's runtime environment.
Why this happens:
You installed @grafana/create-plugin globally on Windows (C:\Users\sushilk\AppData\Roaming\npm).
When you run it inside WSL, it uses that Windows installation which may not support proper execution under WSL.
The package expects to run in a native Linux environment, but the Windows global install causes conflicts.
How to fix this properly
Uninstall the Windows global install of @grafana/create-plugin (in Windows PowerShell):
powershell
npm uninstall -g @grafana/create-plugin
Then, in WSL (Ubuntu shell), install the plugin tools fresh inside WSL native environment:
bash
npm install -g @grafana/create-plugin
(You already installed Node.js and npm correctly in WSL, so this installs the package fully within Linux.)
Now, run the command from inside WSL:
bash
create-plugin my-llm-plugin
You should now have a working environment because:
The package is installed in the same environment where you're running the command.
The file paths and Node.js runtime are consistent.
Summary
Step
Location
Uninstall @grafana/create-plugin
Windows PowerShell
Install @grafana/create-plugin
WSL / Ubuntu shell
Run create-plugin command
WSL / Ubuntu shell
Additional tip for node global path conflicts in WSL:
Make sure your WSL user npm global folder is properly set. You can check your WSL global npm bin folder with:
bash
npm bin -g
It should be something like /home/your-username/.npm-global/bin or under /usr/local/bin depending on configuration.
If you want, I can guide you through removal, reinstallation, and plugin creation cleanly step-by-step!
TypeError: command is not a function
at file:///mnt/c/Users/sushilk/AppData/Roaming/npm/node_modules/@grafana/create-plugin/dist/bin/run.js:27:1
at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Node.js v22.17.0
Assistant
The root cause here is that even inside WSL, you're running the Windows-installed version of @grafana/create-plugin from the /mnt/c/Users/sushilk/AppData/Roaming/npm folder rather than the Linux-native install inside WSL.
What’s happening?
Your create-plugin command is resolved to Windows npm global binaries folder (/mnt/c/Users/...).
Running Windows-installed Node.js binaries from within WSL causes this runtime error.
You installed Node.js in WSL, but the command still links to Windows-installed binary.
How to fix: Use the WSL-installed create-plugin instead
Step 1: Uninstall the Windows global package (from Windows PowerShell, not WSL)
Open Windows PowerShell (not WSL terminal) and run:
powershell
npm uninstall -g @grafana/create-plugin
Step 2: Inside WSL, uninstall any existing global package under Windows folder (optional)
Make sure no Windows paths remain aliased in WSL for create-plugin:
bash
which create-plugin
If it points to /mnt/c/..., that confirms it's the Windows binary.
Next, verify that the Linux-native create-plugin command is the one that will run:
bash
which create-plugin
Expected output should be something like:
code
/home/sushilk/.npm-global/bin/create-plugin
or
code
/usr/local/bin/create-plugin
If full path points correctly, create your plugin project:
bash
create-plugin my-llm-plugin
This should start the interactive plugin scaffolding without errors.
Recap:
You’ve installed the plugin toolkit inside native WSL environment.
Running create-plugin now should run the Linux native version, not the Windows one.
From here, you can build your Grafana LLM plugin using the latest supported tooling.
If you want, I’m ready to help you:
Scaffold the plugin.
Add @grafana/llm dependency.
Write example plugin code using @grafana/llm.
Build and deploy the plugin in your Grafana Docker container.
Just let me know!
User
sushilk@DVCI6116383:whichcreate−plugin/mnt/c/Users/sushilk/AppData/Roaming/npm/create− which create-plugin
sushilk@DVCI6116383:$ npm install -g @grafana/create-plugin
added 66 packages in 2s
21 packages are looking for funding
run npm fund for details
sushilk@DVCI6116383:~whichcreate create-plugin my-llm-plugin
file:///mnt/c/Users/sushilk/AppData/Roaming/npm/node_modules/@grafana/create-plugin/dist/bin/run.js:27
command(argv);
^
TypeError: command is not a function
at file:///mnt/c/Users/sushilk/AppData/Roaming/npm/node_modules/@grafana/create-plugin/dist/bin/run.js:27:1
at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Node.js v22.17.0
sushilk@DVCI6116383:~$
Assistant
Thanks for sharing this — it confirms the core problem: Even inside WSL, your shell is picking up the Windows-installed create-plugin under /mnt/c/Users/sushilk/AppData/Roaming/npm/create-plugin instead of the Linux-native one installed inside WSL.
Why does this happen?
Your WSL $PATH includes the Windows npm global bin directory (/mnt/c/Users/sushilk/AppData/Roaming/npm) before any Linux-native npm bin folder, so create-plugin resolves to the incompatible Windows version every time.
Solution: Fix your WSL $PATH and force use of the Linux-native binaries
Step 1: Find your Linux-native global npm bin folder
Run:
bash
npm bin -g
Typical output examples:
/home/sushilk/.npm-global/bin
/usr/local/bin
Step 2: Modify your PATH to prioritize Linux global bin folder over Windows mounted paths
Edit your ~/.bashrc (or ~/.profile or ~/.zshrc, whichever shell you use), add this at the very top:
bash
export PATH="$(npm bin -g):$PATH"
Or, if you want to hardcode (replace with your actual output of npm bin -g), e.g.:
bash
export PATH=/home/sushilk/.npm-global/bin:$PATH
Step 3: Reload your shell
bash
source ~/.bashrc
Step 4: Confirm that create-plugin points to Linux-native
bash
which create-plugin
Now it must not start with /mnt/c, but point to a Linux path, for example:
code
/home/sushilk/.npm-global/bin/create-plugin
Step 5: Run your command now
bash
create-plugin my-llm-plugin
This time it should run the Linux-native version and not give the TypeError: command is not a function error.
Optional: Remove Windows global install to avoid confusion
On Windows PowerShell (outside WSL):
powershell
npm uninstall -g @grafana/create-plugin
Summary
Problem
Fix
WSL uses Windows create-plugin
Prepend Linux npm bin dir to PATH in WSL config file
Windows global install exists
Uninstall it in Windows PowerShell
If you want, I can provide exact commands to fix PATH and clean up your environment step-by-step!
User
sushilk@DVCI6116383:~$ npm bin -g
Unknown command: "bin"
To see a list of supported npm commands, run:
npm help
sushilk@DVCI6116383:~$
Assistant
The npm bin -g command showing Unknown command: "bin" inside WSL again indicates you're running an old or broken npm version inside WSL.
Why is this happening?
WSL's npm seems outdated or corrupted, which causes modern npm commands like bin to be unrecognized.
How to fix npm in WSL
Step 1: Check your Node.js and npm versions inside WSL
Run:
bash
node -v
npm -v
If npm version is below 5.x, that is very outdated.
Step 2: Update npm inside WSL
Run this command in WSL shell:
bash
sudo npm install -g npm@latest
(This updates npm globally inside WSL)
Step 3: Close and reopen WSL shell, then verify
bash
node -v
npm -v
npm bin -g
Now npm bin -g should work correctly.
Once npm bin -g works, fix your PATH as previously described:
Add the npm global bin folder to your PATH in ~/.bashrc or equivalent, and reload the shell.
Summary
Your npm inside WSL is outdated (no bin command).
Update npm inside WSL with sudo npm install -g npm@latest.
Restart shell and verify.
Then fix PATH and re-run create-plugin.
Let me know if you want detailed help updating npm inside WSL!
node -v output seems unusual (npm -vv22.17.0) — it looks like a copy-paste mixup.
But npm -v reports 11.4.2, which is a recent npm version.
Node.js version should be around v22.x (from your previous output).
Given that npm -v shows 11.4.2, npm bin -g should be supported, but you got an error earlier.
This might be caused by the shell or an alias shadowing the command.
Let's troubleshoot:
1. Try to run npm bin -g explicitly:
bash
npm bin --global
or
bash
npm --bin --global
(Just as alternative invocations.)
2. Check if there's an alias or function overriding npm:
Run:
bash
type npm
If output says npm is aliased to ... or npm is a function, that might cause problems.
3. Try running npm help to see if bin is listed:
bash
npm help
Look for the bin command in the list.
4. Run npm commands with verbose logging to see detail:
bash
npm bin -g --loglevel silly
If none of these work, as a workaround:
You can try a common default global bin path on Linux/WSL, which is often:
/home/sushilk/.npm-global/bin
or /usr/local/bin
Try:
bash
ls -l ~/.npm-global/bin/create-plugin
ls -l /usr/local/bin/create-plugin
to verify if create-plugin is there.
Meanwhile, to fix your immediate problem:
Manually prepend the folder containing create-plugin to your PATH.
If create-plugin command runs but is linked from /mnt/c/..., then remove the Windows global install (npm uninstall -g ... from Windows) and make sure your Linux bin directories come first in PATH, for example:
bash
export PATH=~/.npm-global/bin:$PATH
Add that line to your .bashrc and source ~/.bashrc after.
Then re-try:
bash
which create-plugin
If you want, I can guide you through each of these checks step-by-step!
User
sushilk@DVCI6116383:~$ npm --bin --global
npm warn Expanding --bin to --bin-links. This will stop working in the next major version of npm.
npm
Usage:
npm install install all the dependencies in your project
npm install add the dependency to your project
npm test run this project's tests
npm run run the script named
npm -h quick help on
npm -l display usage info for all commands
npm help search for help on (in a browser)
npm help npm more involved overview (in a browser)
The output shows that npm is actually resolving to the Windows-installed version (npm@11.4.2 at C:\Users\sushilk\AppData\Roaming\npm\node_modules\npm), not the WSL-native Linux version.
You are in WSL, but your npm command is actually running Windows's npm!
This explains why npm bin -g is unknown and why your tooling is broken: the environment mixes Windows binaries with WSL, leading to confusion.
This confirms that your WSL $PATH includes Windows npm binaries ahead of Linux-native ones.
How to fix this — enforce Linux-native Node and npm usage in WSL
Step 1: Remove/uninstall global npm from Windows (to avoid accidental execution)
Your $PATH clearly shows many Windows directories mounted via WSL's /mnt/c/... paths after the standard Linux system paths, but also includes Windows Node.js and npm bins here:
(Adjust paths if your actual create-plugin lives somewhere else.)
Save and exit (Ctrl+O, Enter, Ctrl+X).
Step 3: Reload your shell
bash
source ~/.bashrc
Step 4: Verify again that the Linux-native create-plugin is first in PATH:
bash
which create-plugin
Expected output: something like
code
/usr/local/bin/create-plugin
or
code
/home/sushilk/.npm-global/bin/create-plugin
NOT /mnt/c/...
User
sushilk@DVCI6116383:ls/.npm−global/bin/create−pluginusr/local/bin/create−pluginl ls /usr/local/bin/create-plugin
ls: cannot access '/usr/local/bin/create-plugin': No such file or directory
sushilk@DVCI6116383:$
Assistant
You don't currently have create-plugin installed in the usual Linux bin folders.
Since ls didn't find the binary under either ~/.npm-global/bin/ or /usr/local/bin/, the WSL-native global npm install of @grafana/create-plugin either:
Installed somewhere else,
Or npm global prefix is non-standard / misconfigured,
Or the install didn't place the binary properly.
Let's find out where npm global binaries are currently installed in your WSL:
Run inside WSL:
bash
npm config get prefix
This will show the directory where npm installs global packages.
Common scenarios:
If the prefix is something like /usr, binaries install to /usr/bin or /usr/local/bin.
If prefix is /home/sushilk/.npm-global, the binaries go to /home/sushilk/.npm-global/bin.
If prefix points to Windows /mnt/c/... paths, npm will install Windows binaries, which you don’t want inside WSL.
Next, list the files in the npm global bin folder:
Run:
bash
ls -l $(npm bin -g)
If npm bin -g is an unknown command (due to npm glitches), try:
bash
ls -l $(npm config get prefix)/bin
Based on this info, here are your next actions:
1. If prefix points inside /mnt/c, you need to reset your npm global prefix to a local folder.
Example:
bash
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
Make sure to add ~/.npm-global/bin to your PATH (in .bashrc):
bash
export PATH="$HOME/.npm-global/bin:$PATH"
Then reinstall @grafana/create-plugin:
bash
npm install -g @grafana/create-plugin
2. If prefix is local but binary isn't found:
Try reinstalling @grafana/create-plugin globally.
Summary
Run sequentially:
bash
npm config get prefix
ls -l $(npm config get prefix)/bin
Let me know the output of these commands so I can help you fix the setup fully!
User
sushilk@DVCI6116383:~$ npm config get prefix
C:\Users\sushilk\AppData\Roaming\npm
Assistant
This confirms the root cause: your npm global prefix inside WSL is set to your Windows folder:
code
C:\Users\sushilk\AppData\Roaming\npm
This causes your global npm packages (like create-plugin) to install to Windows paths, which WSL tries to run but can't properly because it's a Linux environment.
To fix this — set a proper Linux-global npm prefix inside WSL, separate from your Windows setup
Step 1: Create a local npm global directory in your WSL home:
bash
mkdir -p ~/.npm-global
Step 2: Configure npm to use this directory as your global prefix:
bash
npm config set prefix '~/.npm-global'
Step 3: Add this new bin directory to your PATH in WSL
Edit your .bashrc file:
bash
nano ~/.bashrc
Add this line at the end or beginning:
bash
export PATH="$HOME/.npm-global/bin:$PATH"
Save and exit (Ctrl+O, Enter, Ctrl+X).
Step 4: Reload your .bashrc to update your environment
bash
source ~/.bashrc
Step 5: Verify your new prefix and PATH
bash
npm config get prefix
echo $PATH
which npm
which create-plugin
You should now see:
Prefix: /home/sushilk/.npm-global
Your PATH includes /home/sushilk/.npm-global/bin
which npm points to /home/sushilk/.npm-global/bin/npm (or /usr/bin/npm if fallback)
which create-plugin likely no longer exists (if not yet installed)
Step 6: Now install your @grafana/create-plugin globally in WSL with the new prefix
bash
npm install -g @grafana/create-plugin
Step 7: Verify install
bash
which create-plugin
This should point to something like:
code
/home/sushilk/.npm-global/bin/create-plugin
Step 8: Run the plugin creation command
bash
create-plugin my-llm-plugin
Summary
The core problem was your npm global prefix inside WSL was still set to a Windows path, which caused cross-environment confusion
Setting a local Linux prefix and installing plugins inside WSL removes this conflict and will allow you to run create-plugin successfully.
Let me know if you want me to help you step-by-step through this!
User
i ran the export PATH="HOME/.npm−global/bin:PATH" in WSL....i think it was a mistake...how can i restart my WSL shell?
Assistant
No worries! Running export PATH="$HOME/.npm-global/bin:$PATH" just temporarily prepends that directory to your current shell session's PATH. It won't cause harm and can be easily reset by closing or restarting the shell.
To restart your WSL shell:
Simply close your current terminal window (PowerShell, Windows Terminal, or your console).
Then open a new WSL terminal/window (e.g., launch Ubuntu or your WSL distro again).
When you open a new session, the PATH will be reset to your configured login environment (your .bashrc or .profile scripts).
To confirm your PATH after restart:
Open WSL terminal.
Run:
bash
echo $PATH
This will show the effective PATH.
Note:
Temporary manual export PATH=... commands affect only that terminal session.
To persist changes across sessions, add the export line in your ~/.bashrc (or shell config).
If you want to undo the export immediately without restarting, run:
bash
# Remove that directory from PATH for the current session
export PATH=$(echo $PATH | sed -e 's|'"$HOME/.npm-global/bin:"'||')
Let me know if you want help verifying your environment or setting persistent PATH correctly!
It looks like you are inside the docker-desktop WSL distribution shell (i.e., your prompt is docker-desktop:~#).
The docker-desktop distro is a special internal WSL instance used by Docker Desktop for Windows to manage its containers, and it's not intended for typical user operations like installing packages or running development tools.
What to do next:
You need to open your normal WSL user distro shell, typically your Ubuntu (or other Linux distro) WSL instance, not the special docker-desktop distro.
How to get into your normal WSL user distro:
Open Windows Terminal, Command Prompt, or PowerShell and type:
powershell
wsl
or if you have multiple distros installed, specify your user distro explicitly, e.g.:
powershell
wsl -d Ubuntu
or replace Ubuntu with your actual distro name:
powershell
wsl -l -v
to list installed distros and their status.
Then check your PATH in that shell:
bash
echo $PATH
In that normal distro shell you can:
Set your npm prefix.
Update your PATH.
Install @grafana/create-plugin.
Scaffold your plugin.
Summary
Do NOT run development commands inside docker-desktop WSL distro.
Use your normal Linux distro in WSL (Ubuntu, Debian, etc).
Make sure npm global prefix and PATH are properly configured in your user distro.
If you want, I can help you fully reset and prepare your user distro environment for Grafana plugin development!
If you want, I can guide step-by-step once you're inside Ubuntu WSL.
Summary
You need to explicitly open and work inside your Ubuntu WSL distro, not docker-desktop.
Use wsl -d Ubuntu to start and enter Ubuntu.
Then follow the Node.js/npm/Grafana plugin setup steps.
Let me know when you're inside Ubuntu and ready for next instructions!
User
sushilk@DVCI6116383:/mnt/c/WINDOWSnpmconfiggetprefix/usrsushilk@DVCI6116383:/mnt/c/WINDOWS echo 'export PATH="HOME/.npm−global/bin:PATH"' >> ~/.bashrc
~/.bashrcsushilk@DVCI6116383:/mnt/c/WINDOWSsource/.bashrcsushilk@DVCI6116383:/mnt/c npm install -g @grafana/create-plugin
npm error code EACCES
npm error syscall mkdir
npm error path /usr/lib/node_modules/@grafana
npm error errno -13
npm error Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/@grafana'
npm error at async mkdir (node:internal/fs/promises:858:10)
npm error at async /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:624:20
npm error at async Promise.allSettled (index 0)
npm error at async [reifyPackages] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:325:11)
npm error at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:142:5)
npm error at async Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:207:9)
npm error at async module.exports (/usr/lib/node_modules/npm/lib/cli/entry.js:74:5) {
npm error errno: -13,
npm error code: 'EACCES',
npm error syscall: 'mkdir',
npm error path: '/usr/lib/node_modules/@grafana'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm notice
npm notice New major version of npm available! 10.9.2 -> 11.4.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.4.2
npm notice To update run: npm install -g npm@11.4.2
npm notice
npm error A complete log of this run can be found in: /home/sushilk/.npm/_logs/2025-06-27T10_47_13_149Z-debug-0.log
means you don't have permission to write to /usr/lib/node_modules, which is where npm tries to install global packages by default.
How to fix this permission issue in WSL
Option 1: Use a local (user-owned) global npm directory (recommended)
You partially set it up by adding this line in your .bashrc:
bash
export PATH="$HOME/.npm-global/bin:$PATH"
But your npm global prefix is still /usr as shown:
code
npm config get prefix
/usr
So you need to tell npm to use your local .npm-global directory as prefix:
Run:
bash
npm config set prefix '~/.npm-global'
Then reinstall @grafana/create-plugin globally (to your local .npm-global folder):
bash
npm install -g @grafana/create-plugin
This will install packages under your home directory, avoiding permissions issues.
Option 2 (if you want to install globally system-wide):
Run the install command with sudo (not recommended for most cases):
bash
sudo npm install -g @grafana/create-plugin
But this may cause permission conflicts later and is less preferred.
After changing prefix, verify config and paths:
bash
npm config get prefix
# Should show /home/sushilk/.npm-global
echo $PATH
# Should have /home/sushilk/.npm-global/bin near the front
which create-plugin
# Should point to /home/sushilk/.npm-global/bin/create-plugin after installation
If you want, I can help you with all these steps in detail!
21 packages are looking for funding
run npm fund for details
sushilk@DVCI6116383:/mnt/c/WINDOWSnpmconfiggetprefix/home/sushilk/.npm−globalsushilk@DVCI6116383 echo $PATH
/home/sushilk/.npm-global/bin:/home/sushilk/.npm-global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/Eclipse Adoptium/jdk-21.0.3.9-hotspot/bin:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Graphviz/bin:/mnt/c/Users/sushilk/Downloads/ffmpeg-master-latest-win64-gpl-shared/ffmpeg-master-latest-win64-gpl-shared/bin:/mnt/c/ffmpeg/bin:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/InfluxData/influxdb:/mnt/c/Program Files/InfluxData/telegraf/telegraf-1.29.3:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/dotnet/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Program Files/nodejs/:/mnt/c/Users/sushilk/AppData/Roaming/npm:/mnt/c/Users/sushilk/AppData/Local/Programs/Python/Python311/Scripts/:/mnt/c/Users/sushilk/AppData/Local/Programs/Python/Python311/:/mnt/c/Users/sushilk/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/sushilk/AppData/Roaming/Python/Python310/Scripts:/mnt/c/Users/sushilk/myenv/Scripts:/mnt/c/Users/sushilk/AppData/Local/Programs/Ollama:/mnt/c/Users/sushilk/.dotnet/tools:/mnt/c/Users/sushilk/AppData/Local/Programs/cursor/resources/app/bin:/mnt/c/Program Files/Tesseract-OCR:/mnt/c/poppler/poppler-24.08.0/Library/bin:/snap/bin
Assistant
Great! Your npm config get prefix now shows:
code
/home/sushilk/.npm-global
and your $PATH includes /home/sushilk/.npm-global/bin near the front, so your environment is now set up properly for local global npm packages inside WSL.
Next step: Verify that the create-plugin binary is installed and accessible
Run:
bash
which create-plugin
Expected output should be:
code
/home/sushilk/.npm-global/bin/create-plugin
Now, run the Grafana plugin scaffolding command:
bash
create-plugin my-llm-plugin
This will scaffold a new Grafana plugin project named my-llm-plugin.
After scaffolding:
cd my-llm-plugin
Edit or add @grafana/llm as a dependency:
bash
npm install @grafana/llm@0.22.0
Build the plugin:
bash
npm run build
To load your plugin into Docker Grafana:
Mount the plugin folder into the container's /var/lib/grafana/plugins directory when running Docker.
Example:
powershell
docker run -d -p 50001:3000 --name=grafana -v /home/sushilk/my-llm-plugin:/var/lib/grafana/plugins grafana/grafana
(Make sure to replace the path with your actual Linux path or use WSL path translation //wsl$/Ubuntu/home/sushilk/my-llm-plugin in Windows.)
If you want, I can guide you with example plugin code using @grafana/llm and further steps. Just ask!
TypeError: command is not a function
at file:///home/sushilk/.npm-global/lib/node_modules/@grafana/create-plugin/dist/bin/run.js:27:1
at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
TypeError: command is not a function
at .../@grafana/create-plugin/dist/bin/run.js:27:1
and it's a known issue caused by @grafana/create-pluginnot supporting Windows paths inside WSL, especially when your current working directory is on the Windows filesystem /mnt/c/....
Root Cause
@grafana/create-plugin's current versions require the project to be created inside the Linux filesystem (not a mounted Windows folder) for paths and module loading to work correctly.
Running the command while your shell is at /mnt/c/WINDOWS (mounted Windows filesystem) leads to this error because some ES modules don't handle Windows-style paths in WSL well.
How to fix
1. Run plugin creation inside Linux filesystem
Change to your WSL home directory or any Linux-native folder, e.g.:
bash
cd ~
or
bash
mkdir -p ~/projects
cd ~/projects
Then run:
bash
create-plugin my-llm-plugin
This ensures all plugin files and tool operations happen inside the Linux file system (/home/sushilk/...), avoiding path and permission issues.
2. Access your project from Windows if needed
If you want to use your Windows editors like VS Code:
Use the WSL path syntax:
code
\\wsl$\Ubuntu\home\sushilk\projects\my-llm-plugin
in Windows Explorer or VS Code's "Open Folder" dialog.
Summary
Your working directory /mnt/c/WINDOWS is on Windows FS, leading to problems with @grafana/create-plugin.
Switch to Linux home or a native Linux path inside WSL.
Run create-plugin inside Linux filesystem.
Access source code in Windows using \\wsl$ paths if needed.
If you want, I can help you with step-by-step commands to set up a proper project folder in Linux filesystem and create your plugin successfully.
User
sushilk@DVCI6116383:/mnt/c/windowsmkdir−p/projectssushilk@DVCI6116383:/mnt/c/windows cd /projects
sushilk@DVCI6116383:/projects$ create-plugin my-llm-plugin
file:///home/sushilk/.npm-global/lib/node_modules/@grafana/create-plugin/dist/bin/run.js:27
command(argv);
^
TypeError: command is not a function
at file:///home/sushilk/.npm-global/lib/node_modules/@grafana/create-plugin/dist/bin/run.js:27:1
at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Node.js v22.17.0
Assistant
This ongoing TypeError: command is not a function from @grafana/create-plugin is due to a known compatibility issue between the plugin tooling and the current Node.js version (v22.x) or how modules are imported/executed.
What’s going on?
The plugin tool (@grafana/create-plugin) is currently not fully compatible with the latest Node.js 22.x versions.
The error originates from ES module loading in the CLI script trying to invoke the command.
This is a reported issue, not unique to your environment.
Recommended Solutions
1. Use Node.js v18 LTS instead of v22
@grafana/create-plugin currently works best with Node.js 16.x or 18.x LTS versions, and not with the latest v22.
How to downgrade Node.js inside WSL (recommended):
Option A: Use nvm (Node Version Manager) — best if you want multiple Node.js versions
Grafana Labs will eventually fix compatibility with newer Node.js versions, but for immediate use, downgrading is the easiest fix.
Summary
Problem
Fix
Plugin toolkit incompatible with Node.js v22
Use Node.js v18 LTS version inside WSL
If you'd like, I can guide you step-by-step to install and switch Node.js to v18 using nvm!
User
sushilk@DVCI6116383:~/projectsnvmuse18Youruser’s.npmrcfile({HOME}/.npmrc)
has a globalconfig and/or a prefix setting, which are incompatible with nvm.
Run nvm use --delete-prefix v18.20.8 to unset it.
Assistant
The message means your ~/.npmrc file has a prefix or globalconfig setting that conflicts with nvm’s environment management.
To fix this, run:
bash
nvm use --delete-prefix v18.20.8
This tells nvm to ignore/remove the conflicting prefix temporarily for that session.
After that, verify which Node/npm you’re using:
bash
node -v
npm -v
If you want to permanently fix the conflict:
Open the .npmrc file:
bash
nano ~/.npmrc
Look for lines containing prefix= or globalconfig=
Comment them out by adding # at the start, or delete those lines.
Save and exit (Ctrl + O, Enter, Ctrl + X)
Then reload your shell:
bash
source ~/.bashrc
After that, you can safely run:
bash
nvm use 18
without the --delete-prefix flag if desired.
Let me know if you want me to assist you with these steps!
User
sushilk@DVCI6116383:~/projects$ create-plugin my-llm-plugin
? What is the organization name of your plugin? Sushil
? How would you describe your plugin? Testing for Sushil
? What type of plugin would you like? datasource
? Do you want a backend part of your plugin? Yes
? Do you want to add Github CI and Release workflows? Yes
? Do you want to add a Github workflow for automatically checking "Grafana API compatibility" on PRs? Yes
⠋ [ERROR] Cannot read properties of undefined (reading 'split')
Assistant
You’ve successfully gotten past the initial setup prompts, but now hit this:
code
[ERROR] Cannot read properties of undefined (reading 'split')
This error comes from the plugin scaffolding tool (@grafana/create-plugin) during project generation.
What’s happening?
This is a known bug in certain versions of @grafana/create-plugin when some expected input or default is missing or mishandled internally.
It likely occurs during post-prompt processing or template setup, often related to backend or CI configuration options.
Might also be triggered by Node.js version incompatibility or a bug in the specific plugin scaffolding package version.
How to fix / workaround
1. Upgrade or reinstall latest @grafana/create-plugin
Make sure you have the absolute latest version by:
removed 321 packages in 1s
sushilk@DVCI6116383:~/projects$ npm install -g @grafana/create-plugin
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated lodash.get@4.4.2: This package is deprecated. Use the optional chaining (?.) operator instead.
npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
added 321 packages in 5s
28 packages are looking for funding
run npm fund for details
sushilk@DVCI6116383:~/projects$ node -v
v18.20.8
Assistant
You’ve successfully uninstalled and reinstalled @grafana/create-plugin and verified that you’re now running Node.js v18.20.8 — this is a great environment setup for Grafana plugin development.
Next steps:
Try running the plugin creation again with minimal options to avoid the previous error:
bash
create-plugin my-llm-plugin
When prompted, respond with simple answers, for example:
Organization name: your name or Sushil
Description: Testing plugin
Plugin type: datasource (or something simple)
Backend: No
GitHub CI: No
This reduces complexity and avoids some known bugs in the scaffolding tool.
If the error reappears, try this as an alternative:
Use the older but more stable Grafana toolkit command:
bash
npx @grafana/toolkit plugin:create my-llm-plugin
After successful scaffolding
cd my-llm-plugin
Add the @grafana/llm dependency:
bash
npm install @grafana/llm@0.22.0
Build your plugin:
bash
npm run build
Then mount it in your Docker Grafana container:
bash
docker run -d -p 50001:3000 --name=grafana -v ~/projects/my-llm-plugin:/var/lib/grafana/plugins grafana/grafana
If you want, I can help you create example plugin code using @grafana/llm or assist any step further!
Just let me know how it goes!
User
sushilk@DVCI6116383:~/projectsnode−vv18.20.8sushilk@DVCI6116383:/projects create-plugin my-llm-plugin
? What is the organization name of your plugin? Sushil
? How would you describe your plugin? Sushil AI Test
? What type of plugin would you like? datasource
? Do you want a backend part of your plugin? No
? Do you want to add Github CI and Release workflows? No
? Do you want to add a Github workflow for automatically checking "Grafana API compatibility" on PRs? No
⠋ [ERROR] Cannot read properties of undefined (reading 'split')
Assistant
The error [ERROR] Cannot read properties of undefined (reading 'split')] during plugin scaffolding is a known issue with certain versions of @grafana/create-plugin.
Since you’re on Node.js v18.20.8 and have tried minimal options, here are the best workarounds and next steps:
Workaround 1: Use the legacy toolkit CLI (@grafana/toolkit)
Although deprecated, the older @grafana/toolkit may still scaffold your plugin successfully:
bash
npx @grafana/toolkit plugin:create my-llm-plugin
Try this and see if it completes without error.
Workaround 2: Manually scaffold a basic plugin
If tooling fails, you can manually create a minimal plugin by:
@grafana/create-plugin interactive scaffolding has bugs currently.
Use npx @grafana/toolkit plugin:create as fallback.
Or manually scaffold and build your plugin.
Plugin tools expect some fixes in future versions.
Would you like me to help you scaffold a minimal plugin manually or proceed with @grafana/toolkit fallback?
User
sushilk@DVCI6116383:~/projects$ npx @grafana/toolkit plugin:create my-llm-plugin
Need to install the following packages:
@grafana/toolkit@10.1.10
Ok to proceed? (y) y
The warning confirms that @grafana/toolkit is deprecated, and you should use @grafana/create-plugin instead. Unfortunately, @grafana/create-plugin currently has the "cannot read properties of undefined (reading 'split')" bug during scaffolding.
Given the current state of tooling, here are your best options to move forward:
Option 1: Manual Minimal Plugin Scaffold
You can manually create a minimal plugin folder to start development and add @grafana/llm yourself.
Use an older Node.js version (like v16) and see if scaffolding works.
Run the scaffolder with minimal options and verify if it works.
Summary
The plugin scaffolding tool has a current blocking bug, but you can still:
Scaffold manually and add @grafana/llm yourself.
Track official fixes for @grafana/create-plugin.
Try the scaffolding from older versions or minimal options.
If you want, I can help you kickstart a minimal plugin manually right now!
User
where should i save my plugin and package jason?
Assistant
You should save your Grafana plugin inside your WSL Linux filesystem, ideally in a directory under your home folder, such as ~/projects or ~/grafana-plugins.
For example:
bash
mkdir -p ~/projects/my-llm-plugin
cd ~/projects/my-llm-plugin
Here, create your plugin files such as:
plugin.json (the Grafana plugin descriptor)
package.json (your npm dependencies and scripts)
Source code folders (src/, etc.)
Why inside WSL Linux filesystem?
Running your plugin build & development commands inside WSL works best when files are stored in the Linux filesystem (/home/sushilk/...).
Avoid storing your plugin under /mnt/c/ (Windows-mounted path), because access speeds are slower and some Linux tools / Node.js modules may have issues with Windows-style paths inside WSL.
You can edit these files directly from Windows editors like VS Code via the \\wsl$\Ubuntu\home\sushilk\projects\my-llm-plugin UNC path (or open the folder using the Remote - WSL extension).
If you want, I can help you create a sample folder structure and essential files for your plugin!
User
how can i check path for sushilk@DVCI6116383:~/projects/my-llm-plugin$?
Assistant
To check the full absolute path of your current directory inside WSL (where your prompt shows sushilk@DVCI6116383:~/projects/my-llm-plugin$), you can run:
bash
pwd
This will print the full path, for example:
code
/home/sushilk/projects/my-llm-plugin
What this path means:
/home/sushilk — your WSL Linux home directory
projects/my-llm-plugin — subdirectories inside it
How to access this path from Windows?
Use this UNC path in Windows Explorer or VS Code:
code
\\wsl$\Ubuntu\home\sushilk\projects\my-llm-plugin
(Replace Ubuntu with your WSL distro name if different.)
If you want to see your WSL distro name, run:
bash
cat /etc/os-release
or from Windows Powershell:
powershell
wsl -l -v
Let me know if you want help opening the folder in VS Code or Windows Explorer!