Facing issue with the private network


I have followed the below link to create a private network between two nodes.

I am running the daemon thruough my code written in Node js which is as follows:
const IPFS = require(‘ipfs’)
const node = new IPFS()

node.on(‘ready’, () => {
// start the API gateway
const Gateway = require(‘ipfs/src/http’);
const gateway = new Gateway(node);
return gateway.start();

I am getting the below error, Kindly someone help
throw new Error(‘Private network is enforced, but no protector was provided’)