Last active
October 11, 2024 08:40
-
-
Save valex91/8402175bba1c9c43bc666c249ec1fd83 to your computer and use it in GitHub Desktop.
set into a persistent manner the ENV variable for incresing the heap of nodejs. Work with windows if you got any shell emulator and macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -n "$1" ]; | |
then { | |
setx NODE_OPTIONS "--max-old-space-size=$1" | |
} || { | |
echo "export NODE_OPTIONS='--max-old-space-size=$1'" >> "$HOME/.bash_profile" | |
} | |
echo "successfully set the memory limit to $1MB"; | |
else | |
echo "You need to specify a limit by passing an argument to the script ./increaseNodeSize.sh <amount>"; | |
fi | |
read -p 'Press enter to continue' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment