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

express-generator doesn't work #32

Closed
danilNil opened this issue Jun 10, 2014 · 4 comments
Closed

express-generator doesn't work #32

danilNil opened this issue Jun 10, 2014 · 4 comments

Comments

@danilNil
Copy link

Hello,
I'd like to install express-generator by using this guide: http://expressjs.com/guide.html#executable

But I got error:

MM12-Danil:~ danil$ npm install -g express-generator
npm http GET https://registry.npmjs.org/express-generator
npm http 304 https://registry.npmjs.org/express-generator
npm http GET https://registry.npmjs.org/commander/1.3.2
npm http GET https://registry.npmjs.org/mkdirp/0.3.5
npm http 304 https://registry.npmjs.org/commander/1.3.2
npm http 304 https://registry.npmjs.org/mkdirp/0.3.5
npm http GET https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/keypress
/usr/local/share/npm/bin/express -> /usr/local/share/npm/lib/node_modules/express-generator/bin/express
express-generator@4.2.0 /usr/local/share/npm/lib/node_modules/express-generator
├── mkdirp@0.3.5
└── commander@1.3.2 (keypress@0.1.0)
MM12-Danil:~ danil$ express --help
-bash: express: command not found

So I decided to place bin to /usr/local/bin. Then I got another error:

MM12-Danil:node_js_demo danil$ express --help

module.js:340
    throw err;
          ^
Error: Cannot find module 'commander'
    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.<anonymous> (/usr/local/bin/express:3:15)
    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)

But it works when I installed it locally:

MM12-Danil:photo danil$ npm install express-generator express
npm http GET https://registry.npmjs.org/express-generator
.....
npm http 304 https://registry.npmjs.org/ms/0.6.2
express-generator@4.2.0 node_modules/express-generator
├── mkdirp@0.3.5
└── commander@1.3.2 (keypress@0.1.0)

express@4.4.2 node_modules/express
....
MM12-Danil:photo danil$ node_modules/express-generator/bin/express --help

  Usage: express [options] [dir]

  Options:

    -h, --help          output usage information
    -V, --version       output the version number
    -e, --ejs           add ejs engine support (defaults to jade)
    -H, --hogan         add hogan.js engine support
    -c, --css <engine>  add stylesheet <engine> support (less|stylus|compass) (defaults to plain css)
    -f, --force         force on non-empty directory

May be I did something wrong?

@jonathanong
Copy link
Member

try reinstalling it. seems like an npm issue

@danilNil
Copy link
Author

@jonathanong thanks for quick response! I reinstall npm and now all work.

@jonathanong
Copy link
Member

always try reinstalling :D npm has a lot of issues =/

@akshaygagal
Copy link

@jonathanong not work for me.

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

3 participants