angular-cli: ng build -prod fails with two errors

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) os: win32 x64
  1. Versions. Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version And paste the result here. date it to a more recent version. angular-cli: 1.0.0-beta.2-mobile.4 node: 6.1.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. I have built a small but extensive application. I am attaching some of the configuration files. Please let me know if you need more.

I ran ng init just to make sure I had everything for the CLI. ng build -prod

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

I am not aware of a log file created by build. Here’s the screen shot:

C:\Users\rkr0079\Source\Repos\nrmn-account>ng build -prod (node:6264) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. / Building(node:6264) DeprecationWarning: ‘root’ is deprecated, use ‘global’ (node:6264) DeprecationWarning: ‘GLOBAL’ is deprecated, use ‘global’ Built project successfully. Stored in “dist/”. File sizes: fs.js:95 throw err; // Forgot a callback but don’t know where? Use NODE_DEBUG=fs ^

Error: ENOTEMPTY: directory not empty, rmdir ‘C:\Users\rkr0079\Source\Repos\nrmn-account\dist\vendor\ng2-bootstrap\components’ at Error (native)

nrmn-accounts.zip

  1. Mention any other details that might be useful.

    Thanks! We’ll be in touch soon.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 38 (11 by maintainers)

Most upvoted comments

This fails for me too on Mac. Same error in the tmp folder

Removed all instances of cli and only installed globally. When I tried the build, it complained Cannot find module 'angular-cli/lib/broccoli/angular2-app'.

I installed the cli locally and the build ran.

I’m still having issues with the removal of empty directories. This represents a difference in the dev and prod builds. If something in dev is moved to main.js in prod, it is not cleaning up those directories appropriately. I have to run the prod build three times to get a successful build.

SUCCESS!! main.js is now built in the proper order!!!

@rkralston @kara the broken map errors are fixed in beta.5 (not the mobile one though) but can be fixed in a project by changing angular-cli-build.js and tsconfig.json as shown in https://github.com/angular/angular-cli/pull/839.

Another user ran into a similar problem in -prod mode where nothing failed and yet the app did not load. It also seemed related to a bundling issue where some bundled code broke the rest, see https://github.com/angular/angular-cli/issues/951#issuecomment-222863004 for more details. In that case setting the package format in SystemJS for that specific lib fixed the issue. Can you try and tell me if that works for you?

I have tried updating the CLI with npm i angular-cli. This does not work. How should I update the CLI?

prod compiled. it will not run. should I be looking for bootstrap in that file?

ng serve -prod results in Loading… and the app never runs.

ng serve runs with no problems.