Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt clean fail unable to delete ".tmp" file (EPERM, operation not permitted)

Tags:

gruntjs

yeoman

When I built a yeoman angular app, when I run it for the first time it works fine using grunt serve but when i run it the second time an error from grunt clean task as following:

Cleaning .tmp...ERROR
Warning: Unable to delete ".tmp" file (EPERM, operation not permitted '...\.tmp'). Use --force to continue.

Aborted due to warnings.

When I delete the .tmp folder manually the app runs without errors.

I searched the net and here but I couldn't find a convincing answer.

Please advice,

like image 857
Ya Basha Avatar asked May 08 '14 12:05

Ya Basha


3 Answers

Was having a similar issue running "grunt build" from Mac. Issue turned out to be file permissions, to fix I did "sudo chmod -R ." on the root directory and it fixed the issue.

like image 30
cchamberlain Avatar answered Jan 03 '23 12:01

cchamberlain


I was able to fix this issue by updating the version of the rimraf node module inside of grunt-contrib-clean.

$ cd .\node_modules\grunt-contrib-clean 
$ npm install [email protected]

This looks like the commit in rimraf that fixed the issue: https://github.com/isaacs/rimraf/commit/1b612ed9370b5a3d0de9bb0ba1a32ea1dc8edba1

like image 199
dload Avatar answered Jan 03 '23 11:01

dload


  1. Check if any explorer of the directory you are trying to delete is open. If so, close the explorer and clean.
  2. Try this simple solution(Sometimes problem might be due to empty folder).
    It works for me :

clean : {
  dist : ['./dist'+'/**/*.*']
 }
like image 43
Raj sree Avatar answered Jan 03 '23 10:01

Raj sree