balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.83k stars 1.95k forks source link

Forever restarting because of /.tmp #614

Closed chrismcclellan closed 11 years ago

chrismcclellan commented 11 years ago

Running forever -w start app.js causes infinite restarting by files being changed in /.tmp

Zolmeister commented 11 years ago

sails lift by default will watch for changes (though it's possibly hitting the watcher debounce), alternatively you can run grunt default to get just the grunt watcher.

Zolmeister commented 11 years ago

Duplicate of #366 Workaround: .foreverignore file

**/.tmp/**
mikedevita commented 11 years ago

:+1: this goes for using supervisor as well.

tobinharris commented 11 years ago

Will sails lift watch changes to .coffee files? Mine doesn't seem to be restarting.

geekgonecrazy commented 11 years ago

Mine isn't restarting either. Obviously the ejs stuff it auto reloads on the fly. But not the js stuff.

Maybe this could be made more clear as to what exactly its watching? I'd love to be able to throw out supervisor/nodemon etc.

@mikermcneil @Zolmeister

balaphp commented 10 years ago

Please give any solution for live code update without restart.... i cant start to develop the application without get solution for this.

robertmerten commented 10 years ago

I've used nodemon https://github.com/remy/nodemon. You can place a .nodemonignore file in the root folder and put /.tmp/* in it. Worked out pretty well.

balaphp commented 10 years ago

@robertmerten is it working with version 0.9.7 ?

robertmerten commented 10 years ago

@phpbala Hm, using version 0.9.4. Don't know if something has changed. Did you test with nodemon?

balaphp commented 10 years ago

@robertmerten .. Hi, I have installed nodemon and then followed your steps (created .nodemonignore file and added /.tmp/* code). is there anything i have to do?

robertmerten commented 10 years ago

@phpbala Start the app with "nodemon app.js" and it should work. Nodemon tells you which file caused a reload so have a look at the terminal if you have any issues. You can post it here and I can try to see what's going wrong. Just to make sure that I understand the issue: You want the nodejs server to reload but no Live Reload ( automatic browser restart )

balaphp commented 10 years ago

Hi @robertmerten : This is what i am getting.....

Balaphp:hangman balaganesh$ nodemon app.js 4 Nov 21:21:26 - [nodemon] v0.7.10 4 Nov 21:21:26 - [nodemon] to restart at any time, enter rs 4 Nov 21:21:26 - [nodemon] watching: /Users/balaganesh/Sites/hangman 4 Nov 21:21:26 - [nodemon] starting node app.js 4 Nov 21:21:26 - [nodemon] reading ignore list

module.js:340 throw err; ^ Error: Cannot find module 'sails' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/Users/balaganesh/Sites/hangman/app.js:3:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) 4 Nov 21:21:26 - [nodemon] app crashed - waiting for file changes before starting...

sgress454 commented 10 years ago

Your app.js file attempts to lift the Sails installed in your project's local node_modules directory, which by default doesn't exist for projects created with sails new. If you want to start your app with node app.js (or nodemon app.js), you'll need to install Sails locally for your application by either doing npm install sails in your app directory or symlinking node_modules/sails to your global Sails folder.

robertmerten commented 10 years ago

That should do it :)

balaphp commented 10 years ago

Cheers and thanks.... its working now... Thanks @sgress454 and @robertmerten.....:-)....