Use sudo before npm install.Because you have to give permission to write in /usr/lib/ when you are installing globally. so use sudo npm install express-generator -g.

Answer from puneet gupta on Stack Overflow
🌐
Express.js
expressjs.com › en › starter › generator.html
Express application generator
Use the application generator tool, express-generator, to quickly create an application skeleton. You can run the application generator with the npx command (available in Node.js 8.2.0). ... For earlier Node versions, install the application ...
🌐
npm
npmjs.com › package › express-generator
express-generator - npm
May 3, 2019 - Express' application generator. Latest version: 4.16.1, last published: 7 years ago. Start using express-generator in your project by running `npm i express-generator`. There are 34 other projects in the npm registry using express-generator.
      » npm install express-generator
    
Published   May 03, 2019
Version   4.16.1
Author   TJ Holowaychuk
Discussions

node.js - Node npm install -g express generator - Stack Overflow
I get the following message after npm install -g express generator install. I have tried everything I know how to fixed this. Is there another way for me to install this without getting this error More on stackoverflow.com
🌐 stackoverflow.com
node.js - How can I create an Express EJS project from the command line? - Stack Overflow
As of Express 4.x, install express-generator npm install -g express-generator and then use express -e myproject More on stackoverflow.com
🌐 stackoverflow.com
Should I use the Express 4 (generator) or use the bare-bones Express
I think if you are asking this question, you should probably learn to write an express based app, from the ground up, and then once you are pretty comfortable doing it, decide if using a generator / boilerplate is going to help or not. More on reddit.com
🌐 r/node
11
9
June 28, 2014
(Node Express) Error in installing express-generator

May not be the best approach, but the following worked for me

rm -Rf /usr/local/lib/node_modules/express

rm -Rf /usr/local/bin/express

npm install express -g

npm install express-generator -g

More on reddit.com
🌐 r/learnprogramming
1
3
March 8, 2013
🌐
Webscale
section.io › engineering-education › nodejs-app-express-generator
Creating Node.js Application Using Express Generator
June 24, 2025 - E-commerce is evolving at an incredible rate. Online stores now operate across a multitude of cloud environments, headless architectures, and global storefronts. Each new integration and experience layer generates opportunities...
🌐
GeeksforGeeks
geeksforgeeks.org › node.js › what-is-express-generator
What is Express Generator
July 23, 2025 - Express Generator is a Node.js Framework like ExpressJS which is used to create express Applications easily and quickly. It acts as a tool for generating express applications.
🌐
GitHub
github.com › expressjs › generator
GitHub - expressjs/generator: Express' application generator
$ npm install -g express-generator · You can also run the application generator with the npx command (available since Node.js 8.2.0). $ npx express-generator · The quickest way to get started with express is to utilize the executable express(1) ...
Starred by 1.9K users
Forked by 552 users
Languages   JavaScript 94.5% | EJS 2.4% | Pug 0.8% | Twig 0.7% | Handlebars 0.4% | HTML 0.3%
🌐
SitePoint
sitepoint.com › blog › javascript › create new express.js apps in minutes with express generator
Create New Express.js Apps in Minutes with Express Generator
November 13, 2024 - This installs the Express generator as a global package, allowing you to run the express command in your terminal: ... This creates a new Express project called myapp, which is then placed inside of the myapp directory: ... If you’re unfamiliar with npm, it’s the default Node.js package manager.
🌐
YouTube
youtube.com › watch
NodeJS Essentials 22: Express Generator - YouTube
In this tutorial, we'll look at the Express Generator and how you can use it to generate a skeleton ExpressJS project.In the previous NodeJS Essentials tutor...
Published   June 11, 2019
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn › Server-side › Express_Nodejs › skeleton_website
Express Tutorial Part 2: Creating a skeleton website
November 23, 2024 - This tutorial uses the version ... by the Express Application Generator. These are not (necessarily) the latest version, and you should update them when deploying a real application to production. You should already have installed the generator as part of setting up a Node development environment. As a quick reminder, you install the generator tool site-wide using the npm package manager, ...
🌐
CodeForGeek
codeforgeek.com › home › express complete tutorial : part 1
Express Complete tutorial : Part 1 | CodeForGeek
June 20, 2021 - I choose second option always because it seems easy to deploy. npm install -g express npm install --save express · Update : Now express separates their app generator into module called ‘express-generator’. Install it using.
🌐
npm
npmjs.com › package › express-app-generator
express-app-generator - npm
November 18, 2020 - Genrate node app with express with simple routing. Latest version: 1.0.6, last published: 5 years ago. Start using express-app-generator in your project by running `npm i express-app-generator`. There are no other projects in the npm registry using express-app-generator.
      » npm install express-app-generator
    
Published   Nov 18, 2020
Version   1.0.6
Author   Hardeep Singh
Top answer
1 of 10
18
express --help

  Usage: express [options] [path]

  Options:
    -s, --sessions           add session support
    -t, --template <engine>  add template <engine> support (jade|ejs). default=jade
    -c, --css <engine>       add stylesheet <engine> support (stylus). default=plain css
    -v, --version            output framework version
    -h, --help               output help information

so, do >express -t ejs [path]

2 of 10
10

How to install express from the command line using express-generator and use EJS template engine


1) Install express-generator globally("-g") if you don't have it already

npm install express-generator -g


2.1) Check available commands

express -h 

Result(in express version: 4.13.4):

  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)
    --hbs           add handlebars engine support
-H, --hogan         add hogan.js engine support
-c, --css <engine>  add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)
    --git           add .gitignore
-f, --force         force on non-empty directory

2.2) Generate an Express app with chosen preferences

express --ejs --git my_app_with_ejs_and_gitignore

Result:

   create : my_app_with_ejs_and_gitignore
   create : my_app_with_ejs_and_gitignore/package.json
   create : my_app_with_ejs_and_gitignore/app.js
   create : my_app_with_ejs_and_gitignore/.gitignore
   create : my_app_with_ejs_and_gitignore/public
   create : my_app_with_ejs_and_gitignore/public/javascripts
   create : my_app_with_ejs_and_gitignore/public/images
   create : my_app_with_ejs_and_gitignore/public/stylesheets
   create : my_app_with_ejs_and_gitignore/public/stylesheets/style.css
   create : my_app_with_ejs_and_gitignore/routes
   create : my_app_with_ejs_and_gitignore/routes/index.js
   create : my_app_with_ejs_and_gitignore/routes/users.js
   create : my_app_with_ejs_and_gitignore/views
   create : my_app_with_ejs_and_gitignore/views/index.ejs
   create : my_app_with_ejs_and_gitignore/views/error.ejs
   create : my_app_with_ejs_and_gitignore/bin
   create : my_app_with_ejs_and_gitignore/bin/www

   install dependencies:
     $ cd my_app_with_ejs_and_gitignore && npm install

   run the app:
     $ DEBUG=my_app_with_ejs_and_gitignore:* npm start


3) Navigate into the app directory and use NPM to install dependencies

cd my_app_with_ejs_and_gitignore
npm install


Result:

+-- [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]
| +-- [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]


4) Start the server

DEBUG=my_app_with_ejs_and_gitignore:* npm start

Result:

[email protected] start C:\Users\Marian\OneDrive\Documente\Practice\Node\express_generator_2\my_app_with_ejs_and_gitignore
node ./bin/www
Sun, 31 Jul 2016 13:51:25 GMT my_app_with_ejs_and_gitignore:server Listening on port 3000


5) See the result in the browser
Open a browser and navigate to: http://localhost:3000/

The page should contain the following text:
Express
Welcome to Express

🌐
Medium
medium.com › mtholla › create-a-node-js-app-using-the-express-application-generator-tool-6bdc00e797dc
Create a Scalable Node.js App Using the Express Application Generator Tool | by Matt Holland | mattholland | Medium
October 4, 2018 - Create a Scalable Node.js App Using the Express Application Generator Tool Article summary: Create a scalable Node.js application using the Express generator starter tool, including modular routes & …
🌐
Packtpub
subscription.packtpub.com › book › web-development › 9781785888434 › 1 › ch01lvl1sec9 › installing-express-generator
Installing Express generator | Node.js 6.x Blueprints
The generator helps us in creating the initial code of our application and we can modify it to fit into our application. Simply type the following command in your terminal or shell: npm install -g express ·
🌐
npm
npmjs.com › package › express
express - npm
1 week ago - Installation is done using the npm install command: ... Follow our installing guide for more information. ... The quickest way to get started with express is to utilize the executable express(1) to generate an application as shown below:
      » npm install express
    
Published   Dec 01, 2025
Version   5.2.1
Author   TJ Holowaychuk
🌐
npm
npmjs.com › package › express-oas-generator
express-oas-generator - npm
Module to automatically generate OpenAPI (Swagger) specification for existing ExpressJS 4.x REST API applications. Latest version: 1.0.48, last published: 8 months ago. Start using express-oas-generator in your project by running `npm i ...
      » npm install express-oas-generator
    
Published   Apr 08, 2025
Version   1.0.48
Author   Matvey Pashkovskiy