I can not create project using Express Node.js

3

I'm following a Node.js tutorial and I'm learning about frameworks, but when I try to install express by cmd of error, I'm trying to do it like this:

express aplicativo1

And the error that appears in cmd is this:

  

'express' is not recognized as an internal command       or external, operable program or batch file.

    
asked by anonymous 02.07.2015 / 16:48

1 answer

7

It seems to me that you are calling two different packages 'express':

  • express ( link ) and
  • express-generator ( link )
  • The first is a web framework and the second is only used to create a directory structure for the web framework express .

    Note also that the -p option of npm is to install packages globally on your operating system, which in general makes the commands provided by the package stay in the system PATH and can be accessed directly on the system. command terminal.

    So, the error you got:

      

    'express' is not recognized as an internal or external command, an operable program, or a batch file.

    This occurred because your operating system did not find the 'express' command in your PATH, due to the fact that the express package does not have an 'express' command, even if it is installed globally. This command is the express-generator package, and in order to use this command from any directory, this package must be installed globally using the npm -g option.

    I hope you have helped clarify your doubts a bit further and continue to study and learn more about Node.js

        
    15.08.2015 / 16:10