Step 1. Install node package manager (npm) by going to https://nodejs.org/
and click INSTALL
Step 2. Check that npm
is installed:
npm -v
Step 3. Install gulp globally
npm install -g gulp
Step 4. Install requirements
cd myproject
npm install # this will create node_modules/ subdirectory in your directory
Step 5. Make sure your flask port is set to 5003
:
# app.py
if __name__ == '__main__':
app.run(debug=True, port=5003)
Step 6. Run gulp
gulp # this will run flask and open a browser
First, make sure the file you're editing is valid HTML because browsersync injects javascript into your file. Here is a simple valid html file:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h5>hello world</h5>
</body>
</html>
If you have trouble connecting, make sure the port is set to the correct port. Trying closing your browser. Also, you might have to goto the BrowserSync control panel (localhost:3001) and click 'Reload Browser' to refresh it.