Repository navigation
ng build -prod fails to clean up files #1068
Description
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 10
- 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.5
node: 5.6.0
os: win32 x64 - Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
ng build works fine but ng build -prod fails giving error below. You can reproduce with my code from https://github.com/lamaan/angular2-salah-times - The log given by the failure. Normally this include a stack trace and some
more information.
C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times>ng build -prod
Cleanup error.
ENOTEMPTY: directory not empty, rmdir 'C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\tmp\broccoli_type_script_compiler-cache_path-973l28
5M.tmp\src\app'
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\tmp\broccoli_type_script_compiler-cache_path
-973l285M.tmp\src\app'
at Error (native)
at Object.fs.rmdirSync (fs.js:806:18)
at rmkidsSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:247:11)
at rmdirSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:237:7)
at fixWinEPERMSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:150:5)
at rimrafSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:216:26)
at C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:245:5
at Array.forEach (native)
at rmkidsSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:244:26)
at rmdirSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:237:7)
at fixWinEPERMSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:150:5)
at rimrafSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:216:26)
at C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:245:5
at Array.forEach (native)
at rmkidsSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:244:26)
at rmdirSync (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\quick-temp\node_modules\rimraf\rimraf.js:237:7)
Build failed.
The Broccoli Plugin: [BundlePlugin] failed with:
Error on fetch for angular2-google-maps/core.js at file:///C:/Users/Lamaan/AAAWork/shariahstandards.org/app/angular2-salah-times/tmp/bundle_plugin-input_base_pa
th-XrdEiDow.tmp/0/angular2-google-maps/core.js
Loading main.js
Error: ENOENT: no such file or directory, open 'C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\tmp\bundle_plugin-input_base_path-
XrdEiDow.tmp\0\angular2-google-maps\core.js'
at Error (native)
The broccoli plugin was instantiated at:
at BundlePlugin.Plugin (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\broccoli-plugin\index.js:10:31)
at BundlePlugin.CachingWriter [as constructor](C:UsersLamaanAAAWorkshariahstandards.orgappangular2-salah-timesnode_modulesbroccoli-caching-writeri
ndex.js:21:10)
at BundlePlugin (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib\broccoli\angular-broccoli-bundle.js:10:3
6)
at Angular2App._getBundleTree (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib\broccoli\angular2-app.js:4
21:22)
at Angular2App._buildTree (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib\broccoli\angular2-app.js:159:2
1)
at new Angular2App (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib\broccoli\angular2-app.js:53:23)
at module.exports (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\angular-cli-build.js:8:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib
\models\builder.js:55:19)
at Class.module.exports.Task.extend.init (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib\models\builder.
js:89:10)
at new Class (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\core-object\core-object.js:18:12)
at Class.module.exports.Task.extend.run (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib\tasks\build.js:1
5:19)
at C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\angular-cli\lib\commands\build.js:32:24
at lib$rsvp$$internal$$tryCatch (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (C:\Users\Lamaan\AAAWork\shariahstandards.org\app\angular2-salah-times\node_modules\rsvp\dist\rsvp.js:1198:9)
- Mention any other details that might be useful.
Activity
lamaan commentedon Jun 12, 2016
this was just windows not deleting files correctly and some other config errors which have now been resolved
SijanC147 commentedon Jun 15, 2016
I know this is closed but I'm facing the very same issue and was wondering how did you resolve this?
lamaan commentedon Jun 15, 2016
Just had to delete the tmp folder manually. Initially, it was quite large. But now, I rarely get the problem.
-----Original Message-----
From: "Sean" notifications@github.com
Sent: 15/06/2016 06:46
To: "angular/angular-cli" angular-cli@noreply.github.com
Cc: "lamaan" lamaan@lamaan.com; "State change" state_change@noreply.github.com
Subject: Re: [angular/angular-cli] ng build -prod fails to clean up files (#1068)
I know this is closed but I'm facing the very same issue and was wondering how did you resolve this?
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub:
#1068 (comment)
NgxDev commentedon Jul 29, 2016
angular-cli version: 1.0.0-beta.10
I still get the error. But here's what's causing it for me:
In my "app" folder I have a "+static" folder, in which I've created an
index.ts(as the styleguide recommends):In the same "+static" folder, I have all the necessary components, each in it's own folder:
contact,privacyetc. Each of these folders also has anindex.tswithexport * from './name-of.component';Then, in my
app.routes.tsI have:and, in my
system-config.tsI have the following barrels (created automatically by the cli):Tried the following:
system-config.ts, instead of all those barrels, just putapp/+static. Doesn't work.app.routes.ts, instead of the import { .. } from './+static'; I've actually wrote an import for each component (import { ContactComponent } from './+static/contact';. This works, I don't get the error anymore. But this means theindex.tsin my+staticfolder is useless. And, as far as I know, the styleguide recommends the use of anindex.tsspecifically to have less import statements (like I was trying, toimport { Component1, Component2, Component3 ... } from './+static';So, I'm wondering... If they recommend it, it should work... But it doesn't work. Am I doing something wrong? Or is it a bug? And I should open one accordingly, with the exact scenario I have?
filipesilva commentedon Jul 29, 2016
@MrCroft I can't say one way or another if it's a build bug or a code bug, but since we're moving away from SystemJS config in #1455 it might be a good idea to try that before opening an issue. There's no release yet though.
NgxDev commentedon Jul 29, 2016
@filipesilva
Oh, I'm so sad! I was so avoiding webpack :)
Then again, I've got to hating webpack so so much simply because more and more examples out there were using it, going "against" the default (systemjs) approach of the cli, which is also the default approach in the angular docs/quickstart.
Now I'm wondering if it will be a quick and painless transition, to move my cli app from systemjs to webpack, once the cli will move away from systemjs and towards webpack.
filipesilva commentedon Jul 29, 2016
I've WIP instructions in #1456. Most people seem to think the transition is easy.
lamaan commentedon Aug 5, 2016
Hi,
I have now moved the code to the webpack version and am getting the following curious error from webpack trying to resolve a different dependency injection issue:
It seems that the Provider is not the correct type of provider?
https://github.com/lamaan/angular2-salah-times/tree/dictionary-with-injected-routes https://github.com/lamaan/angular2-salah-times/tree/dictionary-with-injected-routes
Lamaan
From: Filipe Silva [mailto:notifications@github.com]
Sent: 29 July 2016 18:29
To: angular/angular-cli angular-cli@noreply.github.com
Cc: lamaan lamaan@lamaan.com; State change state_change@noreply.github.com
Subject: Re: [angular/angular-cli] ng build -prod fails to clean up files (#1068)
I've WIP instructions in #1456 #1456 . Most people seem to think the transition is easy.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub #1068 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AFcXknye6JGMmFwaPg4Nn9Z3zwYmpKf3ks5qahxQgaJpZM4IzxAR . https://github.com/notifications/beacon/AFcXkhKtWQNTYaQ_PJR9-PcrXfym41FQks5qahxQgaJpZM4IzxAR.gif
lamaan commentedon Aug 6, 2016
Hi again,
I removed the dependency on angular2-google-maps to get it working.
Other problems found using web pack:
Please can you let me know if and when you have any solutions to these?
Lamaan
From: Lamaan Ball [mailto:lamaan@lamaan.com]
Sent: 05 August 2016 07:39
To: 'angular/angular-cli' reply@reply.github.com
Subject: RE: [angular/angular-cli] ng build -prod fails to clean up files (#1068)
Hi,
I have now moved the code to the webpack version and am getting the following curious error from webpack trying to resolve a different dependency injection issue:
It seems that the Provider is not the correct type of provider?
https://github.com/lamaan/angular2-salah-times/tree/dictionary-with-injected-routes https://github.com/lamaan/angular2-salah-times/tree/dictionary-with-injected-routes
Lamaan
From: Filipe Silva [mailto:notifications@github.com]
Sent: 29 July 2016 18:29
To: angular/angular-cli <angular-cli@noreply.github.com mailto:angular-cli@noreply.github.com >
Cc: lamaan <lamaan@lamaan.com mailto:lamaan@lamaan.com >; State change <state_change@noreply.github.com mailto:state_change@noreply.github.com >
Subject: Re: [angular/angular-cli] ng build -prod fails to clean up files (#1068)
I've WIP instructions in #1456 #1456 . Most people seem to think the transition is easy.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub #1068 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AFcXknye6JGMmFwaPg4Nn9Z3zwYmpKf3ks5qahxQgaJpZM4IzxAR . https://github.com/notifications/beacon/AFcXkhKtWQNTYaQ_PJR9-PcrXfym41FQks5qahxQgaJpZM4IzxAR.gif
filipesilva commentedon Aug 15, 2016
@lamaan can you open a new issue for the issue you're still experiencing?
angular-automatic-lock-bot commentedon Sep 6, 2019
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.