I use windows 10 with WSL running Ubuntu on it.
WSL version: 2.4.12.0
Whenever i install a new node package in the grafana project it keeps making this module not found error. Also whatever package i install on the project doesnt work.
Did anybody have this problem before?How do i solve it?
hello
did u try npm i ping only by itself or did u try to install it on a grafana plugin project?
cuz i tried to use the ping.sys.probe function and it created errors.
code is in datasource.ts file
import ping from ‘ping’;<— this part is at the start of the script
I put the code below inside async testDatasource()
var hosts = [‘127.0.0.1’];
hosts.forEach(function(host){
ping.sys.probe(host, function(isAlive){
var msg = isAlive ? ‘host ’ + host + ’ is alive’ : ‘host ’ + host + ’ is dead’;
console.log(msg);
});
});
@neslihanyakay please share your full plugin code in a public repository. I can give it a spin and see if it is something in your plugin or your system.
It is likely something in your system and most likely related to nodejs.
Sometimes with WSL happens that there’s a global window version of nodejs and a local wsl version of nodejs, so make sure you have the correct one installed. (this sounds weird but we’ve have people with similar issues because of this problem with other tools.)