Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp watch doesn't start server #12

Closed
luisrudge opened this issue Feb 4, 2014 · 12 comments
Closed

gulp watch doesn't start server #12

luisrudge opened this issue Feb 4, 2014 · 12 comments

Comments

@luisrudge
Copy link

Hello, when I type gulp watch, my browser doesn't start on the page.
And when i manually type the adddres, here is what i get:

image

@luisrudge
Copy link
Author

C:\Users\deschamps\Desktop\a>gulp watch
[gulp] Using file C:\Users\deschamps\Desktop\a\gulpfile.js
[gulp] Working directory changed to C:\Users\deschamps\Desktop\a
[gulp] Running 'watch'...
[gulp] Finished 'watch' in 2.06 ms

Why is it finishing?

@sindresorhus
Copy link
Member

@kevva

@kevva
Copy link
Member

kevva commented Feb 5, 2014

Try clearing cache and reinstall from master. Should work fine. And by the way, it's port 9000, not 35729. It's just LR listening on that port.

[gulp] Connect LiveReload on 35729 port
[gulp] Finished 'connect' in 5.44 ms
[gulp] Running 'watch'...
[gulp] Finished 'watch' in 20 ms
[gulp] Server started on 9000 port

@kevva kevva closed this as completed Feb 5, 2014
@megaFatXR
Copy link

Hello.
Same error here.
Just installed the generator and my gulpfile watch task is different from de github one. It starts the server on port 35729 and it doesn't work.

// Watch
gulp.task('watch', function () {
    // Listen on port 35729
    server.listen(35729, function (err) {
        if (err) {
            return console.error(err);
        };
        // Watch .html files
        gulp.watch('app/*.html');
        // Watch .scss files
        gulp.watch('app/styles/**/*.scss', ['styles']);
        // Watch .js files
        gulp.watch('app/scripts/**/*.js', ['scripts']);
        // Watch image files
        gulp.watch('app/images/**/*', ['images']);
    });
});

@kevva
Copy link
Member

kevva commented Feb 7, 2014

That's not the current gulpfile.js. Try clear cache and install from master instead.

@s10wen
Copy link
Contributor

s10wen commented Feb 11, 2014

I'm also confused by this, I've ran gulp watch and got:

$ gulp watch
[gulp] Using file /Users/simonowen/GitHub/gulp-test/gulpfile.js
[gulp] Working directory changed to /Users/simonowen/GitHub/gulp-test
[gulp] Running 'watch'...
[gulp] Finished 'watch' in 2.89 ms

Should I try to 'clear cache and install from master'? If so, how do I do this please?

@s10wen
Copy link
Contributor

s10wen commented Feb 11, 2014

Tried updating and starting again, but now I get:

$ gulp watch
[gulp] Using file /Users/simonowen/GitHub/gulp-01/gulpfile.js
[gulp] Working directory changed to /Users/simonowen/GitHub/gulp-01
[gulp] Running 'watch'...
[gulp] Finished 'watch' in 1.23 ms

... Uhoh. Got error listen EADDRINUSE ...
Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1127:5)
    at Server.listen (/Users/simonowen/GitHub/gulp-01/node_modules/tiny-lr/lib/server.js:138:15)
    at Gulp.<anonymous> (/Users/simonowen/GitHub/gulp-01/gulpfile.js:84:12)
    at module.exports (/Users/simonowen/GitHub/gulp-01/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:31:7)
    at Gulp.Orchestrator._runTask (/Users/simonowen/GitHub/gulp-01/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Users/simonowen/GitHub/gulp-01/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Users/simonowen/GitHub/gulp-01/node_modules/gulp/node_modules/orchestrator/index.js:134:8)

@johnpeele
Copy link

I ran npm cache clean and then uninstalled/reinstalled the generator. I am still not getting the latest gulpfile.js and package.json files. Is there something else I need to do in order to get the latest master version of the generator installed?

@passy
Copy link
Member

passy commented Feb 12, 2014

@johnpeele Just check out the generator somewhere and npm link to it.

@s10wen
Copy link
Contributor

s10wen commented Feb 12, 2014

"Just" 😉 - https://the-pastry-box-project.net/brad-frost/2014-January-28

How do you check out the generator and npm link to it please?

@passy
Copy link
Member

passy commented Feb 12, 2014

@s10wen Good article, but I don't think this should require further information since it's very well documented.

  1. google.com/search?q=npm%20link
  2. first link -> https://www.npmjs.org/doc/cli/npm-link.html
  3. git clone https://github.com/yeoman/generator-gulp-webapp/ ~/stuff/generator-gulp-webapp/
  4. mkdir gulp-project; cd gulp-project
  5. npm link ~/stuff/generator-gulp-webapp/

@s10wen
Copy link
Contributor

s10wen commented Feb 12, 2014

Thanks @passy for the awesome response, now up and running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants