Quantcast
Channel: Active questions tagged require - Stack Overflow
Viewing all articles
Browse latest Browse all 166

Cannot find module error in Node.js: Module not found due to incorrect path [closed]

$
0
0

I'm working on a Node.js project and I've encountered a Cannot find module error when trying to require a module. The error looks something like this:Error: Cannot find module ''

I tried requiring the module in index.js and

const express = require('express');const app = express();app.get('/',(req,res)=>{   res.send('done');)}app.listen(1000,()=> console.log('server running on port 1000'))

execute the node file with the following line of code

node index.js

Viewing all articles
Browse latest Browse all 166

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>