When trying to run grunt commands, I get the following error:

Error: EACCES, permission denied '/home' at Object.fs.readdirSync (fs.js:665:18) at Glob._readdir (/home/pathto/magento/node_modules/grunt/node_modules/findup-sync/node_modules/glob/glob.js:662:20) at Glob._process (/home/pathto/magento/node_modules/grunt/node_modules/findup-sync/node_modules/glob/glob.js:446:15) at Glob.iterator (/home/pathto/magento/node_modules/grunt/node_modules/findup-sync/node_modules/glob/glob.js:181:10) at Array.forEach (native) at new Glob (/home/pathto/magento/node_modules/grunt/node_modules/findup-sync/node_modules/glob/glob.js:179:22) at glob (/home/pathto/magento/node_modules/grunt/node_modules/findup-sync/node_modules/glob/glob.js:57:11) at Function.globSync [as sync] (/home/pathto/magento/node_modules/grunt/node_modules/findup-sync/node_modules/glob/glob.js:76:10) at /home/pathto/magento/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js:32:19 at Function.map (/home/pathto/magento/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.js:3509:27)

I've tried numerous fixes like running:

sudo chown -R $USER:$GROUP ~/.npm

And haven't been able to get it to work. I'm assuming this is a permission problem, but not really sure. I tried running grunt commands w/ sudo but it looks like the grunt command isn't in the path for sudo. Any ideas how to fix this?

  • You only set permission for root of magento directory: sudo chown -R 764 /home/pathto/magento and sudo chown -R 774 /home/pathto/magento/var and set user or group for magento directory is apache user.
    – MrTo-Kane
    Jan 1 '17 at 3:28
  • I'm assuming you meant chmod vs chown, but those permissions didn't work for me. Jan 1 '17 at 23:54

you can set recursive permission. For example to set 777 permission for var folder

[user@server ~$]sudo chmod -R 777 /home/user/public_html/var


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.