Skip to content
← Back to Community
Error: Cannot find module '/home/runner/DangerousBiodegradableErrors/index.js'
Profile icon
ManujHazarika

So I'm just a newbie to node.js and I'm using the file system module to copy and paste the content of one txt file to other. But while running the JS file the shell shows the following screen:

~/DangerousBiodegradableErrors$ node index.js
internal/modules/cjs/loader.js:818
throw err;
^

Error: Cannot find module '/home/runner/DangerousBiodegradableErrors/index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
~/DangerousBiodegradableErrors$ node index.js
internal/modules/cjs/loader.js:818
throw err;
^

Error: Cannot find module '/home/runner/DangerousBiodegradableErrors/index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Voters
Profile icon
tDiff1
Profile icon
KyblunkATiu
Profile icon
EthanCato1
Profile icon
BloxianGem
Profile icon
Eastsidaz
Profile icon
swtnk01
Profile icon
Emilzz
Profile icon
natangamer127
Profile icon
ManujHazarika
Comments
hotnewtop
Profile icon
ruiwenge2

move the index.js file out of the intro-to-node folder

Profile icon
ManujHazarika
Profile icon
ManujHazarika
Profile icon
ruiwenge2

no problem! mark as correct? @ManujHazarika