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