Hi all, please i’m super noobie to grunt and bower and the rest of the lot. I am quite familiar with wordpress and i wanted to give roots starter theme a try, but its been giving me problems the whole day.
My development environment is set up on OS Yosemite and i have followed (trying to follow) the instructions that helps set up roots in wordpress and i keep facing this error.
Running "less:dev" (less) task
Warning: Cannot read property 'contents' of undefined Use --force to continue.
Aborted due to warnings.
First, would you please double-check that npm install and bower install run correctly, with no errors?
Next, it looks like someone just had a similar (maybe) issue: Installing on Ubuntu 14.04 - Roots 7.0.2, and their directory was missing the .bowerrc and the .jshintrc files. Can you make sure those are in there?
You could also attempt clearing your node stuff out, and the cache: rm -rf node_modules and rm -rf ~/.npm, npm cache clean
thank you so much for the reply. @JulienMelissas
my directory has the listed files available. And i tried running the code you sent me and re-followed the get started, but still same error.
What i did find out while messing with the gruntfile.js was, when i comment out ‘less:dev’,‘autoprefixer:dev’; (found on line 166 and 167).
it works fine. But, i end up not having main.css in my css folder.
can you post the contents of your less: task? Im wondering if there is an issue with sourceMap. Can you try turning it to false, uncomment out less:dev and autoprefixer:dev and try again?
Looking at this makes me think that maybe there is an issue in your version of LESS?
There is also indication that this might be an issue with your actual LESS code, such as syntax errors. Have you made any changes to the default LESS files? Styled anything?
Can you give us some information about your dev environment then? I’m not seeing anything immediately pop out at me, but I have a sneaking suspicion that its not directly roots related.
Have you tried just trying to roll a test with grunt/less? You could try to create a basic grunt file to compile a simple less file and see if that works?
okay great, i have solved that problem.
The problem was to do with permission issues. my environment was setup in the home (/) directory and i simply moved it in my_user (/Users/your_username/) directory. that way, write priviledges are allowed.
Thank you all for the time you took to help.
Much appreciated.
I was having this same issue on Win 7 when trying to work with Roots 7.0.3.
I tried various fixes listed above, as well as attempting to use Roots 7.0.2 which was previously working for me, though this time I started getting the error with it as well.
I reinstalled/upgraded node.js with the latest version then tried setting up 7.0.3 again and this time it worked without the error.