nodejs icon indicating copy to clipboard operation
nodejs copied to clipboard

Error: Cannot find module './Controllers/user'

Open y9c opened this issue 9 years ago • 6 comments

module.js:327
    throw err;
    ^

Error: Cannot find module './Controllers/user'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.exports.setRequestUrl (/xxxx/Coding/nodejs/nodejs/NodeSample/routes.js:3:16)
    at Object.<anonymous> (/xxxx/nodejs/nodejs/NodeSample/app.js:27:11)
    at Module._compile (module.js:397:26)
    at Object.Module._extensions..js (module.js:404:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)

The 'controllers' folder start with a lowercase letter 'c', but the importing command starts with capital letter 'C'.

y9c avatar Jan 18 '16 02:01 y9c

if(!path.existsSync(root)){
         ^

TypeError: path.existsSync is not a function

y9c avatar Jan 18 '16 02:01 y9c

yeah,the project is created early,it is not suitable in current Node and Express,i'm gonna modify it.

licongmu avatar Jan 18 '16 05:01 licongmu

looking forword

y9c avatar Jan 18 '16 06:01 y9c

Looking forward

coderefractor avatar Apr 13 '16 04:04 coderefractor

I am having same issue....also looking forward for the same

rahulg30 avatar Feb 16 '19 22:02 rahulg30

check the names of the file and folders. spelling mistakes bring error too

Firdousrida avatar Nov 23 '21 02:11 Firdousrida