I'm working with nodejs (version v4.2.1) I would like to work with gulp I've installed gulp (3.9.0) But when I try my default script with an empty function (script below) with the command gulp I get the error
Error: Cannot find module 'dateformat'
I've tried to install dateformat with
npm install -g dateformat
I can check that dateformat is installed with the command dateformat --help But the gulp script produce the same error
Error: Cannot find module 'dateformat'
I'm working with Windows 7
Any help?
==================== script
var gulp = require('gulp');
gulp.task('default', function() {
});
Had a similar issue and reinstalling gulp globally indeed fixed the issue, however, see my details regarding prior installations of node (since you mention it as well)
npm uninstall gulp -g
npm install gulp -g
The explanation is difficult to precisely offer, since I embarked on an entire troubleshooting effort, but if it is of any help - I suspect the issue is a result of installing node, but the installer is not overwriting prior versions of npm - somehow causing an internal issue somewhere. Troubleshooting flow:
nodejs
folder, located by default at ~\Program Files\ (orphaned node_modules with npm folder found here)
Some more details on the issue can be found here: npm 3 broken when installed from official OS X Node.js installer #10434. While this is specific to OSX, I found the situation identical to myself on the Windows side.
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