node.js - Increase node memory using npm package.json script -
if want increase memory limit in node, option passed be:
node --max-old-space-size=4096 yourfile.js
but in scenario using yarn, package.json looks this:
{ "name": "myapp", "productname": "myapp", "version": "1.0.0", "main": "app/main.js", ... "scripts": { "package-win": "npm run build && build --win --x64", "package-mac": "npm run build && build --mac", ... }, ...
i execute yarn package-win
on windows machine invoke electron-builder electron app built react.js. npm err! code elifecycle
due out of memory. in mac got fatal error: call_and_retry_last allocation failed - javascript heap out of memory
error still got packages generated (how? don't know) when invoking yarn package-mac
.
i search lot on how use --max-old-space-size=4096
option, haven't found works.
i tried "package-win": "node --max-old-space-size=4096 npm run build && build --win --x64",
path have problems locating npm. if use npm, still which
not recognized.
thanks helping.
Comments
Post a Comment