help icon indicating copy to clipboard operation
help copied to clipboard

internal/modules/cjs/loader:936 throw err

Open shoyebmd424 opened this issue 3 years ago • 2 comments

Details

This is my code const express =require('express'); const cors =require('cors'); const {getHome}=require(".route.js"); const { application } = require('express'); const { Console } = require('console'); const app=express(); application.use(cors()); const PORT =500 || process.env.PORT; app.use(getHome); app.listen(PORT,() => Console.log(Server is running on local host ${PORT}));

And this is my error 936 PS C:\Users\Acer\Documents\Web development\web project> node app.js node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module 'express' Require stack:

  • C:\Users\Acer\Documents\Web development\web project\app.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\Users\Acer\Documents\Web development\web project\app.js:1:16) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\Acer\Documents\Web development\web project\app.js' ] }

somebody help me what issue on my code

Node.js version

Node.js v16.13.1.

Example code

No response

Operating system

Windows 10

Scope

NA

Module and version

npm version 8.3.0

shoyebmd424 avatar Jan 07 '22 02:01 shoyebmd424

You need to install the required packages using npm i. For this specific error that would be npm i express.

john-bv avatar Jan 07 '22 05:01 john-bv

ping @shoyebmd424 - is this resolved?

gireeshpunathil avatar Jun 21 '22 03:06 gireeshpunathil

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar May 08 '24 01:05 github-actions[bot]

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] avatar Jun 08 '24 01:06 github-actions[bot]