Pass arguments to “node” executable when running “

2019-07-15 04:37发布

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

标签: node.js npm
1条回答
够拽才男人
2楼-- · 2019-07-15 05:16

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

查看更多
登录 后发表回答