Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EPERM error when running Gulp as non-root

Tags:

node.js

gulp

I'm using Gulp to compile some assets on a simple standalone WordPress theme project.

When I run my gulp task that compiles some LESS files I get the following error:

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: EPERM, chmod '/Users/harryg/Sites/sites/wordpress/wp-content/themes/samarkand-2/assets/css/main.min.css'

When I run it as sudo the task executes without problem.

Thinking it was a permissions error I chmod'd the entire theme folder and its contents to 777 but this doesn't solve the problem. I have gulp installed globally which may be the issue but I'm not sure how to solve.

EDIT

Even if I run the local gulp I get the same error. I.e. running node_modules/.bin/gulp from my project folder produces the same EPERM error.

like image 728
harryg Avatar asked Mar 04 '15 21:03

harryg


1 Answers

`sudo chown -R `whoami` sites/wordpress/wp-content/themes/samarkand-2` 

should fix it. Or whatever directory you want to start from. This is no dangerous and might come because of you node-installation. It's pretty common and should be fixed in general after running installs with [email protected]

like image 125
eljefedelrodeodeljefe Avatar answered Oct 23 '22 05:10

eljefedelrodeodeljefe