lbialy / play-ng2-webpack2

Play 2.6.0 + Angular with Angular-CLI + SBT - based build
Other
55 stars 20 forks source link

Error during ng build: ENOTEMPTY "...\public\ui\" #7

Open ppanuccio opened 7 years ago

ppanuccio commented 7 years ago

I get the following error when I start the application (Windows 10 OS):

--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

> ui@0.0.0 build C:\dev\Play Framework\ocd\ui
> ng build --extract-css --progress --output-path ../public/ui "--watch"

ENOTEMPTY: directory not empty, rmdir 'C:\dev\Play Framework\ocd\public\ui'
Error: ENOTEMPTY: directory not empty, rmdir 'C:\dev\Play Framework\ocd\public\ui'
    at Error (native)
    at Object.fs.rmdirSync (fs.js:886:18)
    at rmkidsSync (C:\dev\Play Framework\ocd\ui\node_modules\rimraf\rimraf.js:355:25)
    at rmdirSync (C:\dev\Play Framework\ocd\ui\node_modules\rimraf\rimraf.js:333:7)
    at Function.rimrafSync [as sync] (C:\dev\Play Framework\ocd\ui\node_modules\rimraf\rimraf.js:303:9)
    at Class.run (C:\dev\Play Framework\ocd\ui\node_modules\@angular\cli\tasks\build.js:25:16)
    at Class.run (C:\dev\Play Framework\ocd\ui\node_modules\@angular\cli\commands\build.js:143:26)
    at Class.<anonymous> (C:\dev\Play Framework\ocd\ui\node_modules\@angular\cli\ember-cli\lib\models\command.js:134:17)
    at process._tickCallback (internal/process/next_tick.js:103:7)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" "--" "--watch"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ui@0.0.0 build: `ng build --extract-css --progress --output-path ../public/ui "--watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ui@0.0.0 build script 'ng build --extract-css --progress --output-path ../public/ui "--watch"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build --extract-css --progress --output-path ../public/ui "--watch"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\dev\Play Framework\ocd\ui\npm-debug.log

It seems the Build Hook can't remove the public/ui directory. If I manually delete such directory, make a clean/compile/run The angular build go further without error.

Somebody have experienced this issue?

Thanks.

Pasquale

ronniegane commented 7 years ago

Could be related to similar errors others have with rimraf: https://github.com/isaacs/rimraf/issues/25 https://github.com/gruntjs/grunt-contrib-clean/issues/34 https://github.com/isaacs/rimraf/issues/72

Do you have anything that could be watching that directory? An explorer window open, virus scanners and Dropbox syncing are possible options mentioned in the linked issues.

ppanuccio commented 7 years ago

Actually it seems there isn't anything that is watching the directory (apart of Intellij IDE open). If was the case...it should happen everytime...even after that I manually delete the directory. If I remove such directory and run clean/compile/run, the problem doesn't happen anymore.