I have installed npm locally according to an article (I don't remember the URL). So that my npm packages are in ~/.npm-packages/
. So gulp is in ~/.npm-packages/bin/gulp
and this is a link: gulp -> ../lib/node_modules/gulp/bin/gulp.js
When I run which gulp
I got /home/victor/.npm-packages/bin/gulp
When I go to the bin directory and run gulp like ./gulp.js -v
I can see it works. However, when I run gulp globally I got such error:
module.js:338
throw err;
^
Error: Cannot find module '/usr/lib/node_modules/gulp/node_modules/v8flags/3.28.73.flags.json'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/usr/lib/node_modules/gulp/bin/gulp.js:25:22)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
So gulp is trying to find modules in /usr/lib, but why? Why not in my home directory? I have all these modules in ~/.npm-packages/lib/node_modules/gulp/node_modules
I'm absolutely confused and can't get gulp working. I've tried to reinstall it with the same effect.
This is what I did to solve the problem:
And that's it. The last instruction will create the required file.
This is what I did to solve the problem:
sudo npm install gulp && sudo npm install --save del && sudo gulp build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With