0

Please or Register to create posts and topics.

Can not create my project exception JavaScript heap out of memory

Hi,

I added new features to my project today.  If I want to create my project with VS Studio 2017, I'll get it ng build --extract-css "--prod" den Fehler angezeigt.

https://github.com/angular/angular-cli/issues/ 5618

This link was given to me during a request because of the problem. Unfortunately I will not be smart.

When I am in the environment from the windows
NODE_OPTIONS = -- max_old_space_size 4096
I can not start Visual Studio 2017 anymore.

What can I do to get the project created?

regards Ingo

Hi,

I resolve the problem:

C:\Users\userName\%AppData%\Roaming\npm

Copy/paste the following code into your ng.cmd.

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe" --max_old_space_size=8048 "%~dp0\node_modules\@angular\cli\bin\ng" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node --max_old_space_size=8048 "%~dp0\node_modules\@angular\cli\bin\ng" %*
)

I found it https://stackoverflow.com/questions/41517738/angular-cli-javascript-heap-out-of-memory-on-asset-optimization

Hi,

After updating to QuickApp Pro 2.7.2, this error occurs again in Visual Studio 2017.

The

"build": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build",

 

error can be corrected if the following change is made in package.json:

I am getting the same error and I dont have ng.cmd in C:\Users\userName\%AppData%\Roaming\npm

I tried different options but none worked. I am on an older version (QuickApp Pro - Premium ASP.NET Core/Angular5 Template with Angular Material2)

How do I fix this? Thank you.

Hi speddi,

edit the package.json file.

"scripts": {
  change hier the :
      "build": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build",
Then it works without problems

to add to Ingo, my build is:

"build": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --extract-css --prod",