Run grunt task with node.js arguments on Windows
up vote
3
down vote
favorite
I am running into an out of memory error when running grunt babel. It is solved on mac by increasing max-old-space-size. However some of our developers are on windows machines and I have not found a way to do this on windows.
What is the equilevant of:
node --max-old-space-size=10000 node_modules/.bin/grunt babel
on windows?
Or is there a universal command that works on both?
My dependencies:
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"grunt-babel": "^8.0.0",
"grunt": "^0.4.5",
"grunt-cli": "^1.3.1",
My babel config in gruntfile.js
My babel config in gruntfile.
babel: {
options: {
compact: true,
presets: ['@babel/preset-env'],
sourceMap: true,
inputSourceMap: sourceMapInJson)
},
},
Error I was getting on Mac and still getting on Windows without increasing max-old-space-size:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Error I am getting on Windows with max-old-space-size param:
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
javascript node.js cmd terminal gruntjs
|
show 3 more comments
up vote
3
down vote
favorite
I am running into an out of memory error when running grunt babel. It is solved on mac by increasing max-old-space-size. However some of our developers are on windows machines and I have not found a way to do this on windows.
What is the equilevant of:
node --max-old-space-size=10000 node_modules/.bin/grunt babel
on windows?
Or is there a universal command that works on both?
My dependencies:
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"grunt-babel": "^8.0.0",
"grunt": "^0.4.5",
"grunt-cli": "^1.3.1",
My babel config in gruntfile.js
My babel config in gruntfile.
babel: {
options: {
compact: true,
presets: ['@babel/preset-env'],
sourceMap: true,
inputSourceMap: sourceMapInJson)
},
},
Error I was getting on Mac and still getting on Windows without increasing max-old-space-size:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Error I am getting on Windows with max-old-space-size param:
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
javascript node.js cmd terminal gruntjs
1
I know that you're asking specifically for windows, I won't be able to help you with that. I just wanted to say, that I had to work on Windows twice (employer requirements) and each time I ended up with setting my own VirtualBox environment with Debian/Ubuntu just for better development experience. If you cannot solve your problem, maybe try running your software in virtualbox or even in a docker where you can use linux as a base, and then pass the --max-old-space-size argument to node. Setting a command that runs docker and runs all tools you need seems to be an overkill but it will work.
– PolishDeveloper
Nov 16 at 17:53
1
Is the command failing on Windows? Does it seem to "work" as in, the command doesn't error out but you still get the error on execution of the task? If latter, just a shot in the dark but have you tried increasing the max on windows? Maybe 10,000 was enough on mac but not Windows...
– klabranche
Nov 16 at 17:55
Are you sure that the command doesn't work on Windows? because, it's supposed to work. I think the same as @klabranche try setting it to a higher value if it doesn't error out. Also, from the documentation, you can set it as an ENV variable and not have to type it out everytime. - nodejs.org/api/cli.html#cli_node_options_optionsenv NODE_OPTIONS=--max_old_space_size=4096
– Aravind Voggu
Nov 16 at 18:00
On windows the command gives out this error: basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list
– Waltari
Nov 19 at 6:58
1
Maybe this plugin can helps: npmjs.com/package/increase-memory-limit
– varit05
Nov 20 at 11:15
|
show 3 more comments
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am running into an out of memory error when running grunt babel. It is solved on mac by increasing max-old-space-size. However some of our developers are on windows machines and I have not found a way to do this on windows.
What is the equilevant of:
node --max-old-space-size=10000 node_modules/.bin/grunt babel
on windows?
Or is there a universal command that works on both?
My dependencies:
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"grunt-babel": "^8.0.0",
"grunt": "^0.4.5",
"grunt-cli": "^1.3.1",
My babel config in gruntfile.js
My babel config in gruntfile.
babel: {
options: {
compact: true,
presets: ['@babel/preset-env'],
sourceMap: true,
inputSourceMap: sourceMapInJson)
},
},
Error I was getting on Mac and still getting on Windows without increasing max-old-space-size:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Error I am getting on Windows with max-old-space-size param:
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
javascript node.js cmd terminal gruntjs
I am running into an out of memory error when running grunt babel. It is solved on mac by increasing max-old-space-size. However some of our developers are on windows machines and I have not found a way to do this on windows.
What is the equilevant of:
node --max-old-space-size=10000 node_modules/.bin/grunt babel
on windows?
Or is there a universal command that works on both?
My dependencies:
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"grunt-babel": "^8.0.0",
"grunt": "^0.4.5",
"grunt-cli": "^1.3.1",
My babel config in gruntfile.js
My babel config in gruntfile.
babel: {
options: {
compact: true,
presets: ['@babel/preset-env'],
sourceMap: true,
inputSourceMap: sourceMapInJson)
},
},
Error I was getting on Mac and still getting on Windows without increasing max-old-space-size:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Error I am getting on Windows with max-old-space-size param:
basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
javascript node.js cmd terminal gruntjs
javascript node.js cmd terminal gruntjs
edited Nov 19 at 6:58
asked Nov 14 at 11:41
Waltari
326728
326728
1
I know that you're asking specifically for windows, I won't be able to help you with that. I just wanted to say, that I had to work on Windows twice (employer requirements) and each time I ended up with setting my own VirtualBox environment with Debian/Ubuntu just for better development experience. If you cannot solve your problem, maybe try running your software in virtualbox or even in a docker where you can use linux as a base, and then pass the --max-old-space-size argument to node. Setting a command that runs docker and runs all tools you need seems to be an overkill but it will work.
– PolishDeveloper
Nov 16 at 17:53
1
Is the command failing on Windows? Does it seem to "work" as in, the command doesn't error out but you still get the error on execution of the task? If latter, just a shot in the dark but have you tried increasing the max on windows? Maybe 10,000 was enough on mac but not Windows...
– klabranche
Nov 16 at 17:55
Are you sure that the command doesn't work on Windows? because, it's supposed to work. I think the same as @klabranche try setting it to a higher value if it doesn't error out. Also, from the documentation, you can set it as an ENV variable and not have to type it out everytime. - nodejs.org/api/cli.html#cli_node_options_optionsenv NODE_OPTIONS=--max_old_space_size=4096
– Aravind Voggu
Nov 16 at 18:00
On windows the command gives out this error: basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list
– Waltari
Nov 19 at 6:58
1
Maybe this plugin can helps: npmjs.com/package/increase-memory-limit
– varit05
Nov 20 at 11:15
|
show 3 more comments
1
I know that you're asking specifically for windows, I won't be able to help you with that. I just wanted to say, that I had to work on Windows twice (employer requirements) and each time I ended up with setting my own VirtualBox environment with Debian/Ubuntu just for better development experience. If you cannot solve your problem, maybe try running your software in virtualbox or even in a docker where you can use linux as a base, and then pass the --max-old-space-size argument to node. Setting a command that runs docker and runs all tools you need seems to be an overkill but it will work.
– PolishDeveloper
Nov 16 at 17:53
1
Is the command failing on Windows? Does it seem to "work" as in, the command doesn't error out but you still get the error on execution of the task? If latter, just a shot in the dark but have you tried increasing the max on windows? Maybe 10,000 was enough on mac but not Windows...
– klabranche
Nov 16 at 17:55
Are you sure that the command doesn't work on Windows? because, it's supposed to work. I think the same as @klabranche try setting it to a higher value if it doesn't error out. Also, from the documentation, you can set it as an ENV variable and not have to type it out everytime. - nodejs.org/api/cli.html#cli_node_options_optionsenv NODE_OPTIONS=--max_old_space_size=4096
– Aravind Voggu
Nov 16 at 18:00
On windows the command gives out this error: basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list
– Waltari
Nov 19 at 6:58
1
Maybe this plugin can helps: npmjs.com/package/increase-memory-limit
– varit05
Nov 20 at 11:15
1
1
I know that you're asking specifically for windows, I won't be able to help you with that. I just wanted to say, that I had to work on Windows twice (employer requirements) and each time I ended up with setting my own VirtualBox environment with Debian/Ubuntu just for better development experience. If you cannot solve your problem, maybe try running your software in virtualbox or even in a docker where you can use linux as a base, and then pass the --max-old-space-size argument to node. Setting a command that runs docker and runs all tools you need seems to be an overkill but it will work.
– PolishDeveloper
Nov 16 at 17:53
I know that you're asking specifically for windows, I won't be able to help you with that. I just wanted to say, that I had to work on Windows twice (employer requirements) and each time I ended up with setting my own VirtualBox environment with Debian/Ubuntu just for better development experience. If you cannot solve your problem, maybe try running your software in virtualbox or even in a docker where you can use linux as a base, and then pass the --max-old-space-size argument to node. Setting a command that runs docker and runs all tools you need seems to be an overkill but it will work.
– PolishDeveloper
Nov 16 at 17:53
1
1
Is the command failing on Windows? Does it seem to "work" as in, the command doesn't error out but you still get the error on execution of the task? If latter, just a shot in the dark but have you tried increasing the max on windows? Maybe 10,000 was enough on mac but not Windows...
– klabranche
Nov 16 at 17:55
Is the command failing on Windows? Does it seem to "work" as in, the command doesn't error out but you still get the error on execution of the task? If latter, just a shot in the dark but have you tried increasing the max on windows? Maybe 10,000 was enough on mac but not Windows...
– klabranche
Nov 16 at 17:55
Are you sure that the command doesn't work on Windows? because, it's supposed to work. I think the same as @klabranche try setting it to a higher value if it doesn't error out. Also, from the documentation, you can set it as an ENV variable and not have to type it out everytime. - nodejs.org/api/cli.html#cli_node_options_options
env NODE_OPTIONS=--max_old_space_size=4096
– Aravind Voggu
Nov 16 at 18:00
Are you sure that the command doesn't work on Windows? because, it's supposed to work. I think the same as @klabranche try setting it to a higher value if it doesn't error out. Also, from the documentation, you can set it as an ENV variable and not have to type it out everytime. - nodejs.org/api/cli.html#cli_node_options_options
env NODE_OPTIONS=--max_old_space_size=4096
– Aravind Voggu
Nov 16 at 18:00
On windows the command gives out this error: basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list
– Waltari
Nov 19 at 6:58
On windows the command gives out this error: basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list
– Waltari
Nov 19 at 6:58
1
1
Maybe this plugin can helps: npmjs.com/package/increase-memory-limit
– varit05
Nov 20 at 11:15
Maybe this plugin can helps: npmjs.com/package/increase-memory-limit
– varit05
Nov 20 at 11:15
|
show 3 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
Npm package increase-memory-limit
would help.
this module fix heap out of memory when running node binaries.
As mentioned in its official docs
it will append --max-old-space-size=4096 in all node calls inside your node_modules/.bin/* files.
Hope this helps!
Actually this doens't fix it on Windows. There was a communication mismatch with my collegue.
– Waltari
Dec 3 at 7:17
Can you trynode --max-old-space-size=8192 {name of the file}
?
– varit05
Dec 3 at 8:17
This doesn't work on windows.
– Waltari
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Npm package increase-memory-limit
would help.
this module fix heap out of memory when running node binaries.
As mentioned in its official docs
it will append --max-old-space-size=4096 in all node calls inside your node_modules/.bin/* files.
Hope this helps!
Actually this doens't fix it on Windows. There was a communication mismatch with my collegue.
– Waltari
Dec 3 at 7:17
Can you trynode --max-old-space-size=8192 {name of the file}
?
– varit05
Dec 3 at 8:17
This doesn't work on windows.
– Waltari
2 days ago
add a comment |
up vote
1
down vote
Npm package increase-memory-limit
would help.
this module fix heap out of memory when running node binaries.
As mentioned in its official docs
it will append --max-old-space-size=4096 in all node calls inside your node_modules/.bin/* files.
Hope this helps!
Actually this doens't fix it on Windows. There was a communication mismatch with my collegue.
– Waltari
Dec 3 at 7:17
Can you trynode --max-old-space-size=8192 {name of the file}
?
– varit05
Dec 3 at 8:17
This doesn't work on windows.
– Waltari
2 days ago
add a comment |
up vote
1
down vote
up vote
1
down vote
Npm package increase-memory-limit
would help.
this module fix heap out of memory when running node binaries.
As mentioned in its official docs
it will append --max-old-space-size=4096 in all node calls inside your node_modules/.bin/* files.
Hope this helps!
Npm package increase-memory-limit
would help.
this module fix heap out of memory when running node binaries.
As mentioned in its official docs
it will append --max-old-space-size=4096 in all node calls inside your node_modules/.bin/* files.
Hope this helps!
answered Nov 23 at 12:45
varit05
1,630715
1,630715
Actually this doens't fix it on Windows. There was a communication mismatch with my collegue.
– Waltari
Dec 3 at 7:17
Can you trynode --max-old-space-size=8192 {name of the file}
?
– varit05
Dec 3 at 8:17
This doesn't work on windows.
– Waltari
2 days ago
add a comment |
Actually this doens't fix it on Windows. There was a communication mismatch with my collegue.
– Waltari
Dec 3 at 7:17
Can you trynode --max-old-space-size=8192 {name of the file}
?
– varit05
Dec 3 at 8:17
This doesn't work on windows.
– Waltari
2 days ago
Actually this doens't fix it on Windows. There was a communication mismatch with my collegue.
– Waltari
Dec 3 at 7:17
Actually this doens't fix it on Windows. There was a communication mismatch with my collegue.
– Waltari
Dec 3 at 7:17
Can you try
node --max-old-space-size=8192 {name of the file}
?– varit05
Dec 3 at 8:17
Can you try
node --max-old-space-size=8192 {name of the file}
?– varit05
Dec 3 at 8:17
This doesn't work on windows.
– Waltari
2 days ago
This doesn't work on windows.
– Waltari
2 days ago
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53299430%2frun-grunt-task-with-node-js-arguments-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I know that you're asking specifically for windows, I won't be able to help you with that. I just wanted to say, that I had to work on Windows twice (employer requirements) and each time I ended up with setting my own VirtualBox environment with Debian/Ubuntu just for better development experience. If you cannot solve your problem, maybe try running your software in virtualbox or even in a docker where you can use linux as a base, and then pass the --max-old-space-size argument to node. Setting a command that runs docker and runs all tools you need seems to be an overkill but it will work.
– PolishDeveloper
Nov 16 at 17:53
1
Is the command failing on Windows? Does it seem to "work" as in, the command doesn't error out but you still get the error on execution of the task? If latter, just a shot in the dark but have you tried increasing the max on windows? Maybe 10,000 was enough on mac but not Windows...
– klabranche
Nov 16 at 17:55
Are you sure that the command doesn't work on Windows? because, it's supposed to work. I think the same as @klabranche try setting it to a higher value if it doesn't error out. Also, from the documentation, you can set it as an ENV variable and not have to type it out everytime. - nodejs.org/api/cli.html#cli_node_options_options
env NODE_OPTIONS=--max_old_space_size=4096
– Aravind Voggu
Nov 16 at 18:00
On windows the command gives out this error: basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list
– Waltari
Nov 19 at 6:58
1
Maybe this plugin can helps: npmjs.com/package/increase-memory-limit
– varit05
Nov 20 at 11:15