Error with findup-sync. Object Gruntfile.js has no method 'flatten'
Hi, I'm on Ubuntu 12.04LTS and trying to use grunt but I get this error when I try to run any grunt tasks. Any ideas?
Running node v0.10.17, grunt-cli v0.1.9, grunt v0.4.1
/workspace/Web Client/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js:33
}).flatten().uniq().value();
^
TypeError: Object Gruntfile.js has no method 'flatten'
at Object.module.exports [as findup] (/workspace/Web Client/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js:33:8)
at Task.task.init (/workspace/Web Client/node_modules/grunt/lib/grunt/task.js:414:16)
at Object.grunt.tasks (/workspace/Web Client/node_modules/grunt/lib/grunt.js:113:8)
at Object.module.exports [as cli] (/workspace/Web Client/node_modules/grunt/lib/grunt/cli.js:38:9)
at Object.<anonymous> (/usr/lib/node_modules/grunt-cli/bin/grunt:41:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Hey @programmerdave, thanks for filing an issue!
Sadly I can't reproduce your issue with node 0.10.18, could you paste your Gruntfile maybe?
Object Gruntfile.js has no method 'flatten' looks really strange.
It sounds like lodash failed to install. I would try npm cache clean and reinstalling everything.
Awesome! I found that it was a bad installation of the modules. I was committing my node_modules folder to git. Then Jenkins was pulling that down and running npm rebuild, grunt build. And what happened was that I was ignoring the dist folder in my .gitignore file so that meant ALL the dist folders where ignored haha my bad. I changed that to /dist on my root directory and then all the dist folders in node_modules where successfully uploaded and now it builds!
Thanks guys
@programmerdave Thanks! I hit the exact same issue. Didn't take out dist from .gitignore.
I bumped into this by accidentally working on my project in node 0.10, then trying to run grunt back in 0.8. Deleting nodule_modules/grunt and running npm install from 0.8 fixed it up.
I had dist/ in all my .gitignore files. Removing it fixed my builds. Thanks @programmerdave!
I did not have dist in my local .gitignore and could not figure this out! I finally found my ~/.gitignore file which had dist in it. That file was a stupid idea. I removed the crap out of it.
Hey guys, same problem here. I tried npm cache clean and removing dits from .gitingnore but having the same issue. I'm using this versions
- node v0.10.26
- npm 1.4.3
- grunt-cli v0.1.13
- grunt v0.4.4
And a very curious thing that is happening to me is that if I run npm install I got the dependencies downloaded in the node_modules fldr as usual without any error, but If I run the command again I get all the dependencies downloaded again, which is not normal in npm
ok, fixed. It seems that deleting the node_modules folder besides the npm clean cache solved it ;)
alias nomnom="rm -rf node_modules && npm cache clean && npm i"
I faced a similar error and installed modules error log complained of not found. Then removed node_modules an cleaned the cache as stated above. Now fixed, thanks to all
Had the same error today. This is how I solved it:
- npm cache clean
- rm -rf node_modules
- Read http://stackoverflow.com/questions/15444020/cannot-find-module-findup-sync-when-trying-to-run-grunt