Search code examples
gulp

gulp error | module path issue | module.js:471 throw err


I am new to gulp and getting this weird error. I am using node v6.9.1, tried with node v8 and v10 as well. Gulp was working fine on my system previously but facing this after i switched to nvm. I tried after npm uninstall, removing node modules, nvm cache clean, delete nvm folder but kind of struck here. Please suggest how to resolve this issue. when i do which gulp then i get msg no gulp in (env path).

gulp -v
module.js:471
 throw err;

Error: Cannot find module ‘C:\(ProjectRepo)\Users(Uid)AppDataRoamingnpmnode_modulesgulpbin'
 at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)

Solution

  • This is finally solved after lot solving series of issues. The above error was coming as i was working in a controlled env and npm i gulp was not installing all files and none under nvm directory. I copied them manually from another system both gulp & gulp-cli and it worked fine after that.