3

I want to run npm run build, but I have to increase stack size like --stack-size=1500, how can I pass it to npm?

Normally I'd run node --stack-size=1500 ./some-script.js --some-arg

Let's say I can't edit package.json

This is not duplicate of Sending command line arguments to npm script because answers there describe how to pass arguments to some-script.js in this case, not to node

1
  • 1
    I'm afraid that there is no way to do it if you can't edit package.json. While editing package.json is possible, see answer of stackoverflow.com/questions/35221098/… Commented Oct 22, 2016 at 4:47

1 Answer 1

5

I've asked a similar question about yarn. It seems that the most convenient option is to use the NODE_OPTIONS environment variable to pass arguments to NodeJS

export NODE_OPTIONS="--stack-size=1500"
npm run build

see also the answer about yarn

Sign up to request clarification or add additional context in comments.

1 Comment

$ NODE_OPTIONS="--stack-size=2000" node results in node: --stack-size= is not allowed in NODE_OPTIONS for node 10.18.1 The same for --stack_size.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.