Giter Site home page Giter Site logo

Comments (11)

dougwilson avatar dougwilson commented on March 28, 2024

Hi! So the output from the generator itself should have said your environment variable needs to be DEBUG=myapp:*, rather than DEBUG=myapp. Does that work?

from generator.

dougwilson avatar dougwilson commented on March 28, 2024

I'm also assuming your app is actually called "myapp". The generator's own output will tell you the true environment variable to set. From your link, it should have told you DEBUG=generator-socket-4.12.1:*

from generator.

kevinSuttle avatar kevinSuttle commented on March 28, 2024

So, in my package.json:

{
  "name": "myapp",
  "main": "app.js",
  "scripts": {
    "start": "node ./bin/www",
    "debug": "DEBUG=myapp node ./bin/www"
  },

In the shell:

DEBUG=myapp:*

In bin/www:

var debug = require('debug')('myapp:server');

from generator.

dougwilson avatar dougwilson commented on March 28, 2024

Ok... We don't add a debug script to the package.json file...

from generator.

dougwilson avatar dougwilson commented on March 28, 2024

What is the output of express --version on your machine?

from generator.

kevinSuttle avatar kevinSuttle commented on March 28, 2024

Yeah the debug was mine. No one uses it anyway. Will delete.

❯ express --version
4.12.1

from generator.

dougwilson avatar dougwilson commented on March 28, 2024

But otherwise, it should print out following the debug command the generatory tool should have displayed to you:

DEBUG=myapp:* node ./bin/www

(note that :* that you were missing from your initial question).

from generator.

kevinSuttle avatar kevinSuttle commented on March 28, 2024

Yeah, I just don't see this output anything to the shell:

  debug('Listening on ' + bind);

from generator.

dougwilson avatar dougwilson commented on March 28, 2024

I'm not having that issue here. Can you send me the complete application you are trying to use (upload to like a Github repo)? Creating a new application here works perfectly:

$ express myapp

   create : myapp
   create : myapp/package.json
   create : myapp/app.js
   create : myapp/public
   create : myapp/public/images
   create : myapp/public/stylesheets
   create : myapp/public/stylesheets/style.css
   create : myapp/views
   create : myapp/views/index.jade
   create : myapp/views/layout.jade
   create : myapp/views/error.jade
   create : myapp/bin
   create : myapp/bin/www
   create : myapp/routes
   create : myapp/routes/index.js
   create : myapp/routes/users.js

   install dependencies:
     $ cd myapp && npm install

   run the app:
     $ DEBUG=myapp:* ./bin/www

   create : myapp/public/javascripts

$ cd myapp
$ npm install
[email protected] node_modules\debug
└── [email protected]

[email protected] node_modules\cookie-parser
├── [email protected]
└── [email protected]

[email protected] node_modules\morgan
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])

[email protected] node_modules\serve-favicon
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])

[email protected] node_modules\body-parser
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected])

[email protected] node_modules\express
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])

[email protected] node_modules\jade
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected])

$ DEBUG=myapp:* ./bin/www
  myapp:server Listening on port 3000 +0ms

I don't know what else to say.

from generator.

kevinSuttle avatar kevinSuttle commented on March 28, 2024

Weird. It just started working on myapp. Rubber-duck debugging at its finest.

Tried this one, and fine as well. https://github.com/kevinSuttle/express-generator-socket

Thanks anyway, @dougwilson. Wish I could point to something that changed so that future people that stumble upon this could have something useful. :/

from generator.

dougwilson avatar dougwilson commented on March 28, 2024

Hm, that's really weird. I really hate that too :( Typically I usually lock complete issues on GitHub, but I'm leaving this open in case you find out what it was and want to post here :)

from generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.