Comments (11)
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.
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.
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.
Ok... We don't add a debug
script to the package.json
file...
from generator.
What is the output of express --version
on your machine?
from generator.
Yeah the debug was mine. No one uses it anyway. Will delete.
❯ express --version
4.12.1
from generator.
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.
Yeah, I just don't see this output anything to the shell:
debug('Listening on ' + bind);
from generator.
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.
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.
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)
- tanks
- Opinionless, minimalist variant HOT 4
- Should the node version < 6 be opted out in travis.yml ? HOT 3
- bash: express: command not found... HOT 3
- fix lodash vulnerability HOT 2
- is this still maintaining? HOT 1
- CORS HOT 1
- Include .gitignore file as part of the initial project setup HOT 1
- myapp HOT 1
- Instructions on how to compile the css engines HOT 4
- option to generate mjs HOT 1
- Recommending nodemon instead of npm start.
- Sass Generator not working out of the box HOT 1
- To bump `pug` to latest >3.x.x
- To automate maintenance of dependency versions in `express-cli.js` HOT 3
- EACCES: permission denied HOT 1
- Dire need for a major update/overhaul HOT 5
- Is express-generator is deprecated or out of maintenance? HOT 1
- Running tests locally fails
- sass instead of node-sass
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator.