Comments (9)
Solution for Azure Pipeline in Azure DevOps:
- task: PowerShell@2
displayName: Build
env:
NODE_OPTIONS: --max_old_space_size=16384
Set the Environment VariableNODE_OPTIONS
with value --max_old_space_size=16384
in your Build-Task.
from aspnetcore-angular-universal.
I do not know why but I got this error last week. I fixed our automated build by updating the webpack script as follows (I put a random higher number).
"build:webpack": "webpack --max_old_space_size=16384 --progress --color",
However, later I read that apparently, the correct approach is to set an environment variable
NODE_OPTIONS=--max_old_space_size=16384
Hope it helps.
from aspnetcore-angular-universal.
Update:
Anyone trying this on Azure build pipeline. I finally got it succeeded. Increased memory to 16384. Please note this step alone wasn't working. Needed same changes in csproj and package.jsonSteps
- Add an
Azure build pipeline task
->Azure powershell script:Inlinescript
before Compile with below settings
steps:- task: AzurePowerShell@3 displayName: 'Azure PowerShell script: InlineScript' inputs: azureSubscription: 'NYCSCA Azure Dev/Test (ea91a274-55c6-461c-a11d-758ef02c2698)' ScriptType: InlineScript Inline: '[Environment]::SetEnvironmentVariable("NODE_OPTIONS", "--max_old_space_size=16384", "Machine")' FailOnStandardError: true azurePowerShellVersion: LatestVersion
@codehippie1 what changes are required for csproj and package.json files?
from aspnetcore-angular-universal.
Update:
Anyone trying this on Azure build pipeline. I finally got it succeeded. Increased memory to 16384. Please note this step alone wasn't working. Needed same changes in csproj and package.json
Steps
- Add an
Azure build pipeline task
->Azure powershell script:Inlinescript
before Compile with below settings
steps:
- task: AzurePowerShell@3
displayName: 'Azure PowerShell script: InlineScript'
inputs:
azureSubscription: 'NYCSCA Azure Dev/Test (ea91a274-55c6-461c-a11d-758ef02c2698)'
ScriptType: InlineScript
Inline: '[Environment]::SetEnvironmentVariable("NODE_OPTIONS", "--max_old_space_size=16384", "Machine")'
FailOnStandardError: true
azurePowerShellVersion: LatestVersion
from aspnetcore-angular-universal.
@alexbenitez I have tried
"build:webpack": "webpack --max_old_space_size=16384 --progress --color",
and it didnt work.
How to set the environment variable for Azure DevOps build agents? Where does the line of code you show go, file, location etc?
from aspnetcore-angular-universal.
@alexbenitez I just added a Azure powershell task to pipeline, just before build to set environment variable at machine level. It didn't work either.
See YAML below
steps:
- task: AzurePowerShell@3
displayName: 'Azure PowerShell script: InlineScript'
inputs:
azureSubscription: 'NYCSCA Azure Dev/Test (ea91a274-55c6-461c-a11d-758ef02c2698)'
ScriptType: InlineScript
Inline: '[Environment]::SetEnvironmentVariable("NODE_OPTIONS", "--max_old_space_size=4096", "Machine")'
FailOnStandardError: true
azurePowerShellVersion: LatestVersion
from aspnetcore-angular-universal.
@alexbenitez thanks for the tip NODE_OPTIONS=--max_old_space_size=16384
. It worked perfectly.
from aspnetcore-angular-universal.
Solución para Azure Pipeline en Azure DevOps:
- task: PowerShell@2 displayName: Build env: NODE_OPTIONS: --max_old_space_size=16384
Establezca la Variable de entorno
NODE_OPTIONS
con valor--max_old_space_size=16384
en su Tarea de compilación.
No funciona, debo tener esta varible en el package
from aspnetcore-angular-universal.
I got this error when trying to run it
2023-08-05T07:55:39.1552140Z ##[section]Starting: PowerShell Script
2023-08-05T07:55:39.1998002Z ==============================================================================
2023-08-05T07:55:39.1998347Z Task : PowerShell
2023-08-05T07:55:39.1998582Z Description : Run a PowerShell script on Linux, macOS, or Windows
2023-08-05T07:55:39.1998804Z Version : 2.220.0
2023-08-05T07:55:39.1999026Z Author : Microsoft Corporation
2023-08-05T07:55:39.1999310Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2023-08-05T07:55:39.1999663Z ==============================================================================
2023-08-05T07:55:41.2025679Z Generating script.
2023-08-05T07:55:41.2852176Z ========================== Starting Command Output ===========================
2023-08-05T07:55:41.3104082Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'F:\Ag2_work_temp\73e90371-e9d8-4834-b4bf-6d8c9cf3f029.ps1'"
2023-08-05T07:55:42.0673357Z ##[error]Exception calling "SetEnvironmentVariable" with "3" argument(s): "Requested registry access is not allowed."
At F:\Ag2_work_temp\73e90371-e9d8-4834-b4bf-6d8c9cf3f029.ps1:4 char:1
- [Environment]::SetEnvironmentVariable("NODE_OPTIONS", "--max_old_spac ...
-
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : SecurityException
2023-08-05T07:55:42.1487257Z ##[error]PowerShell exited with code '1'.
2023-08-05T07:55:42.1767622Z ##[section]Finishing: PowerShell Script
The strange thing is that no one changed the pipeline, as well running old build that were succeding bring the javascript error
from aspnetcore-angular-universal.
Related Issues (20)
- How do I import additional SCSS from new node modules?
- How to set image paths correctly HOT 1
- HTTPS + IIS
- Support Angular 8.0 HOT 6
- Linux/Apache/Nginx hosting and default index.html
- Production Build Problem: Cannot Find Name: Required HOT 3
- Assets and Styles type of behavior
- Adding mime types produces 404 HOT 1
- Uncaught ReferenceError: prebootInitFn is not defined HOT 2
- Build crashing on "Mondays" (Windows)....
- Template is extremely slow
- Does prerendering actually prerender at compile-time or only at runtime? HOT 1
- Feature 'async main' is not available in C# 7.0. Please use language version 7.1 or greater. [C:\temp\aspnetcore-angular-universal-master\Asp2017.csproj]
- cannot set breakpoints and debug the client source codes one line by one line correctly
- lazy loading library (ng-packagr) Can't resolve ngfactory.js
- asp.net core 3.1 HOT 6
- Expo-cli package error
- npm ERR! code ELOCKVERIFY
- Enable Angular universal in asp net core web api project HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnetcore-angular-universal.