By Brian K
I used the one-click install to create a sample MEAN.JS app in the /opt/mean directory. I have successfully started this app and configured nginx to route requests for a particular domain to it.
I am attempting to add a second MEAN.JS app to take requests for another domain. I copied /opt/mean to /opt/mean2, changed the port its listening on from 3000 to 4000, and ran grunt. But it gives me an error that port 35729 is already in use by another process.
If I reboot ubuntu, I can run grunt in either of my apps and start the app successfully. But, when I try to start the other one, I get a fatal error that port 35729 is already in use by another process.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Port 35729 is the default port for Grunt’s live reload feature. It causes your site to automatically refresh if changes are made. It’s great for development, but you might not want it in use in production.
From the Grunt docs:
Type: Boolean or Number Default:
falseSet to
trueor a port number to inject a live reload script tag into your page using connect-livereload.
Yoiu can change its behavior by editing your gruntfile.js file. Find the “watch” section:
watch: {
serverViews: {
files: defaultAssets.server.views,
options: {
livereload: true
}
},
serverJS: {
files: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS),
tasks: ['eslint'],
options: {
livereload: true
}
},
clientViews: {
files: defaultAssets.client.views,
options: {
livereload: true
}
},
clientJS: {
files: defaultAssets.client.js,
tasks: ['eslint'],
options: {
livereload: true
}
},
clientCSS: {
files: defaultAssets.client.css,
tasks: ['csslint'],
options: {
livereload: true
}
},
clientSCSS: {
files: defaultAssets.client.sass,
tasks: ['sass', 'csslint'],
options: {
livereload: true
}
},
clientLESS: {
files: defaultAssets.client.less,
tasks: ['less', 'csslint'],
options: {
livereload: true
}
}
},
Change livereload: true to livereload: false to disable it completely. This sed command would do it all in one shot:
sed -i 's/livereload: true/livereload: false/g' gruntfile.js
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.