1. Install the express framework globally, CMD open the command line, and enter the following command:
npm install -g express
In the express 4.x version, the command tool is separated, a command tool is installed, and the command is executed:
npm install -g express-generator
type express --version
2. If execute js file report error: Error: Cannot find module express
Solution:
execute it again under your own project directory:
npm install express
Read More:
- Node.js Error: Error: Cannot find module ‘express‘ [How to Solve]
- [Solved] Node Create Express Project Error: Failed to lookup view “error“ in views directory
- [Solved] Node error: Error: Cannot find module ‘body-parser‘
- node.js yarn Error: SyntaxError: Unexpected string [How to Solve]
- [Solved] webpack Package Error: ERROR in multi ./src/main.js ./dist/bundle.js Module not found: Error: Can‘t resolv
- [Solved] Node.js: Error: connect ECONNREFUSED ::1:3306
- Error: Cannot find module ‘./application‘ [How to Solve]
- [Solved] Node.js v17 npm run dev Error: opensslErrorStack
- [Solved] node.js Upload Files Error: Multipart: boundary not found multer
- [Solved] NPM node ERROR in main..js from Terser ChildProcessWorker.initialize Excaption
- Node.js Error: “Error: EBUSY: resource busy or locked, stat“
- [Solved] This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/_@babel_runtim
- [Solved] nodejs express Error: MulterError: Unexpected field
- js: SyntaxError: Cannot use import statement outside a module
- [Solved] node.js request Error: Error: unable to verify the first certificate
- [Solved] express-jwt Error: Error: algorithms should be set
- JS to find the last character of the string and remove it
- [Solved] Vue Error: Module build failed Error Node Sass version 6.0.1 is incompatible with ^4.0.0.
- Error Cannot find module ‘worker_threads‘ [How to Solve]
- [webpack-cli] Error: Cannot find module ‘vue/compiler-sfc‘