The NodeJS live-server package runs a temporary server displaying any HTML/CSS/JS resources in the current folder. It automatically reloads the page in your browser when any of these files change.
- Verify that Node.js is installed. If you see anything when you run
which npm
in a terminal, it is. If not, follow the instructions at nodejs.org to install. - Install live-server:
npm install -g live-server
- Move your terminal to where your pages live:
cd <path-to-content>
- Start the server:
live-server .
- Open localhost:8080 in a browser.
I've installed on MacOS 10.14.6 using
npm install -g live-server
and
sudo npm install -g live-server
running node v12.6.0.
live-server
results in
bash: live-server: command not found
I have previously added
export PATH=/Users/Zeesy/.npm-packages/bin
to .bash_profile, but am getting the same error message with or without it. Any recommendadtions on troubleshooting would be appreciated.