1

I'm working through a tutorial on Node.js that begins with a simple authentication program. This is the second time I'm doing this tutorial, and the first time, everything worked fine. However, upon uninstalling node and starting from scratch (installing node.js and express via npm), the instantiation of authentication errors out as below.

program.confirm('destination is not empty, continue? ', function(ok){
              ^
TypeError: Object #<Command> has no method 'confirm'
    at C:\Users\Kyle\AppData\Roaming\npm\node_modules\express\bin\express:251:15

    at C:\Users\Kyle\AppData\Roaming\npm\node_modules\express\bin\express:382:5
    at Object.oncomplete (fs.js:107:15)

I'm on a windows machine, running Node.js v0.10.20 and express v3.4.1.

Is this a result of the inconsistent -g flag install referenced here?

EDIT: Express initializes apps fine in other directories, even those with the subdirectory Node.js. The path to this problem folder is C:\dev\Node.js\ ...any idea why Express refuses to initialize something in this folder?

Community
  • 1
  • 1
kgilvi3
  • 305
  • 3
  • 12

2 Answers2

1

I had the same problem. Rather than fix the problem, you can fix the source of the problem (not specifying an empty directory). In my case I was specifying an empty directory, but it was associating that with the previous switch.

I had to change:

node_modules/.bin/express -s -e -c ./server

To:

node_modules/.bin/express -s -e -c css ./server

Otherwise it thought the server path was the type of css to use and was setting the code path to '.'

DigitalGhost
  • 773
  • 1
  • 5
  • 14
1

Try:

  1. Remove your directory "C:\Users\Kyle\AppData\Roaming\npm\node_modules\express\node_modules\commander".

  2. Install node module "commander 1.3.2" globally. Command line: $ npm install -g commander@1.3.2

  3. Run "express" again.

It seems to be the problem referred to the new version(2.0.0) of the commander module.

It works on my mac.

Good luck~

Tao Van
  • 26
  • 1