Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build -prod fails to clean up files #1068

Closed
lamaan opened this issue Jun 12, 2016 · 11 comments
Closed

ng build -prod fails to clean up files #1068

lamaan opened this issue Jun 12, 2016 · 11 comments

Comments

@lamaan
Copy link

lamaan commented Jun 12, 2016

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 10
  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.5
    node: 5.6.0
    os: win32 x64
  2. 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
  3. 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)

  1. Mention any other details that might be useful.
@lamaan
Copy link
Author

lamaan commented Jun 12, 2016

this was just windows not deleting files correctly and some other config errors which have now been resolved

@lamaan lamaan closed this as completed Jun 12, 2016
@SijanC147
Copy link

I know this is closed but I'm facing the very same issue and was wondering how did you resolve this?

@lamaan
Copy link
Author

lamaan commented 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" [email protected]
Sent: ‎15/‎06/‎2016 06:46
To: "angular/angular-cli" [email protected]
Cc: "lamaan" [email protected]; "State change" [email protected]
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
Copy link

NgxDev commented 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):

export * from './contact';
export * from './privacy';
export * from './support';
export * from './terms-and-conditions';

In the same "+static" folder, I have all the necessary components, each in it's own folder: contact, privacy etc. Each of these folders also has an index.ts with export * from './name-of.component';

Then, in my app.routes.ts I have:

import {
    ContactComponent,
    PrivacyComponent,
    SupportComponent,
    TermsAndConditionsComponent
} from './+static';

and, in my system-config.ts I have the following barrels (created automatically by the cli):

const barrels: string[] = [
    // ...
    'app/+static/contact',
    'app/+static/privacy',
    'app/+static/support',
    'app/+static/terms-and-conditions'
]

Tried the following:

  1. In my system-config.ts, instead of all those barrels, just put app/+static. Doesn't work.
  2. In my 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 the index.ts in my +static folder is useless. And, as far as I know, the styleguide recommends the use of an index.ts specifically to have less import statements (like I was trying, to import { 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
Copy link
Contributor

@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
Copy link

NgxDev commented 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
Copy link
Contributor

I've WIP instructions in #1456. Most people seem to think the transition is easy.

@lamaan
Copy link
Author

lamaan commented 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:[email protected]]
Sent: 29 July 2016 18:29
To: angular/angular-cli [email protected]
Cc: lamaan [email protected]; State change [email protected]
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
Copy link
Author

lamaan commented Aug 6, 2016

Hi again,

I removed the dependency on angular2-google-maps to get it working.

Other problems found using web pack:

  1.  Files are very big. It creates 5Mb main script file and 5 Mb map file. Which is very large for a small app like this.
    
  2.  The source map cannot be parsed – at least by chrome which makes debugging only possible really with console.log.
    
  3.  I cannot see how to include additional npm components as I did with system.js packages – so for now I have managed with using cdn. 
    

Please can you let me know if and when you have any solutions to these?

Lamaan

From: Lamaan Ball [mailto:[email protected]]
Sent: 05 August 2016 07:39
To: 'angular/angular-cli' [email protected]
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:[email protected]]
Sent: 29 July 2016 18:29
To: angular/angular-cli <[email protected] mailto:[email protected] >
Cc: lamaan <[email protected] mailto:[email protected] >; State change <[email protected] mailto:[email protected] >
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
Copy link
Contributor

@lamaan can you open a new issue for the issue you're still experiencing?

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants