angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng build -prod fails with Error: ENOTEMPTY: directory not empty

Open cmermingas opened this issue 10 years ago • 2 comments

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Mac OSX El Capitan


  1. Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.10 node: 4.4.2 os: darwin x64


  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
  1. Create project with angular cli (ng new)
  2. ng serve and ng build work
  3. ng build -prod fails

  1. The log given by the failure. Normally this include a stack trace and some more information.

Carloss-MBP:connect-four cmermingas$ ng github-pages:deploy --user-page Built project successfully. Stored in "dist/". fs.js:60 throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs ^

Error: ENOTEMPTY: directory not empty, rmdir '/Users/cmermingas/web_projects/connect-four/dist/vendor/@angular/platform-browser/' at Error (native)


  1. Mention any other details that might be useful.

I read through Issue #917. I manually removed the directory mentioned in the error. Then it gave me an error with the '@angular' directory. I removed it and then it worked. Since #917 is closed, I decided to open this issue. Not sure if it's a legit bug or I am doing something wrong.


Thanks! We'll be in touch soon.

cmermingas avatar Aug 06 '16 04:08 cmermingas

I'm not too sure of the reason for that problem, since you tried the solutions in the other issue. Off the top of my head, it could be editor related - VSCode often keeps locks on folders, and the only solution is to close the editor.

We're currently moving to a webpack based build system though, and that problem should be completely gone. See https://github.com/angular/angular-cli#webpack-preview-release-update if you're interested in trying it out.

filipesilva avatar Aug 15 '16 01:08 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.