Nodejs Appveyor build running out of memory - node.js

We're running builds on AppVeyor to build an AOT angular 2 application.
The build has started failing, giving the following:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
From what I can tell, you can use --max_old_space_size=xxxx where xxxx is the size you want to increase memory to. The default is 512.
The problem is, I'm not sure where to add this flag. I've tried both dashes (what I found originall) and underscores. I've placed the flag as part of the ps build command definition, in the build scripts build configuration, and in the package.json scripts definitions to no avail.
I'm sure this just has to be put in the right spot, but I'm unclear as to where to add it. Any help would be appreciated.
Thanks

In appveyor.yml:
init:
- ps: Install-Product node 8
- cmd: set NODE_OPTIONS=--max-old-space-size=1028
This sets a node env var during init. Set it as high as you like.
This reduced build times for us by about 80% as well. Incredible.

Related

cypress cache clear hanging

For context I am working in windows 10 with Node.js.
Having set up cypress successfully after a load of trial and error in one project file I am starting from scratch with another project file to work out the exact steps.
For some reason it is failing with the new attempt and having noticed the errors show v 7/3/0 whereas the errors for the previous showed v 7.2.0 I thought I'd return to the first project file and try
cypress clear cache as recommended at docs.cypress.io/guides/references/troubleshooting which I've assumed that was to be run at the Node.js command prompt.
Having done so Node.js is just hanging.
Is this expected behaviour?
Have I misunderstood the instructions?
Thanks

Trying to build UE 4.25 fork/SpatialOS on Ubuntu 20 Linux

I am trying to build this fork of Unreal Engine 4.25 on Ubuntu 20 Linux: https://github.com/improbableio/UnrealEngine
$ ./Setup.sh
works fine, all success!
$ ./GenerateProjectFiles.sh
here I get many warnings like the following:
Attempting to set up UE4 pretty printers for gdb (existing UE4Printers.py, if any, will be
overwritten)… updated UE4Printers.py found necessary entries in ~/.gdbinit file, not changing it.
Setting up Unreal Engine 4 project files… Fixing inconsistent case in filenames.
Setting up Mono Generating data for project indexing… 0%
Wrong build env! WARNING: Exception while generating include data for UE4Editor: Unable to instantiate module ‘UVAtlas’:
Wrong build env! (referenced via Target → ProxyLODMeshReduction.Build.cs) Generating data for project indexing… 100% Generating data for project indexing… 0%Wrong build env! … … …
Writing project files… 100%
$ make
after many successful builds the process stops with this message here:
Building UE4Editor…
Using ‘git status’ to determine working set for adaptive non-unity build (/mnt/3091fd7d-024b-4559-a6ee-07633a74e28a/UnrealEngineSpatialOS).
Creating makefile for UE4Editor (no existing makefile)
Wrong build env!
ERROR: Unable to instantiate module ‘UVAtlas’: Wrong build env!
(referenced via Target → ProxyLODMeshReduction.Build.cs)
Would love to work under Linux! I hope you guys can help me!

How can I prevent React and Plotly crashing the development server due to JavaScript heap out of memory?

I am trying to build a create-react-app with react-plotly.js but when the plot components are included the compiler hangs and eventually fails displaying the error:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
I checked the node heap limit using this command:
node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
which returned:
node heap limit = 1456.1747760772705 Mb
I am using the WSL 2 Linux subsystem for Windows.
I have tried editing the package.json and replacing react-scripts start
with node --max_old_space_size=4096 node_modules/.bin/react-scripts start as suggested in this answer but the error was the same. I have also tried reducing it and using 512 as I have read that is sometimes advised if there is not enough space on the machine.
Any ideas how I can get this to work?
I had success resolving this issue by disabling the GENERATE_SOURCEMAP flag in my .env file, ie
GENERATE_SOURCEMAP=false
as suggested by the (slightly unrelated) answer here.

The lightest possible nodejs build

I'm trying to run a small nodejs project on a old router (A part of a challenge) but have ran into problems, as it only has about 6MB of usable memory. First off I ran the build through upx that took the build down to around 6mb. After that I tried using older builds iojs and v1.01. They worked fine except that they lacked features required to run the ws module (the other part of the challenge). After that I ran ./configure with the arguments of --without-dtrace --without-npm --without-etw --without-perfctr --with-icu-source=none but they still refused to bring down the build size. Is there a way to build nodejs in such a way that it runs the ws module and has an output that's under 6MB
Due to memory issue I think this will not work in your case.
Try this one espruino . Here You can read more detally
You should try CivetWeb: https://github.com/civetweb/civetweb It include Websocket and support javascript via Duktape.

How to get build error messages from browserify

We are using Gulp with browserify, and I am having a problem diagnosing an error. Browserify runs, reporting no problems, however, many of the scripts that should have been concatenated into my output js file are missing.
We have found that this can happen if we are missing an npm package (if we need to run npm install), or if there is something wrong with an npm package. The past couple of times it has happened, we have been lucky in that we had only just added 1 package and so we immediately knew where to look.
Now, I have it failing on a dev machine (by fail, I mean that my output .js file is 1/10th the size it should be an missing many js files, but no errors reported). I am not sure which package it is failing on, and I am getting no diagnostics.
I tried hooking .on('error') as described here: https://stackoverflow.com/a/24817446/67038, but there was no additional output.
The output from the Visual Studio Task Runner Explorer looks like this:
[18:17:21] Using gulpfile C:\git\...\Gulpfile.js
[18:17:21] Starting 'browserify:local'...
[18:17:24] Finished 'browserify:local' after 2.63 s
[18:17:24] Starting 'build:local'...
[18:17:24] Finished 'build:local' after 31 ms
Process terminated with code 0.
What can I do to get additional information from Browserify? Is there some sort of logging that I can turn on?
The problem you experienced was caused by the tsify plugin.
Prior to version 1.0.4, there were a number of path-related bugs that could result in empty modules being emitted without any errors being reported to Browserify. These bugs have been fixed and errors are now emitted to Browserify in situations that would have previously resulted in an empty module.

Resources