I had a similar issue now, not exactly the same, but I think my suggested solution will work.
But first, your issue seems you don't have the global node_modules folder in your path. You can check this with echo $PATH
from cmd and set it by searching for "environment variables" after pressing windows button once.
Even if most packages suggest installing them with -g this is actually usually not the best, mainly because your project will not be self-contained.
So you will always need to globally install your dependencies when on a new machine, production server, etc...
While it's convenient to not have to download some packages often used on the development machine, it's much safer to run npm/yarn install without -g and then wait for a minute extra after your cloned the project (i bet many people disagree with me on that).
Anyway, there are a few tricks with live-reload and I found it hard to use unless run as a script. Not only because of this reason but also because it looks for .live-reload.json config inside the home folder for the user and this cant be specified as an argument.
TLDR;
This is the relevant parts from my project, this should work for you as well:
package.json
{
scripts:{
"local": "yarn build && node live-server.js",
"build" : "#install other dependencies"
},
"devDependencies": {
"live-server": "^1.2.1"
}
}
live-server.js
var liveServer = require("live-server");
const path = require('path');
var params = {
port: 8181, // Set the server port. Defaults to 8080.
host: "127.0.0.1", // Set the address to bind to. Defaults to 0.0.0.0 or process.env.IP.
root: path.join(__dirname, '/public'), // Set root directory that's being served. Defaults to cwd.
open: true, // When false, it won't load your browser by default.
wait: 100, // Waits for all changes, before reloading. Defaults to 0 sec.
logLevel: 2, // 0 = errors only, 1 = some, 2 = lots
};
liveServer.start(params);