Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ara's avatar
Level 3

Hooks and npm install

Hi guys.

I am using Elixir and what I would like to do is a hook to run gulp --production. The thing is, I have to run npm install everytime to install the modules and that increases my memory by way too much. Just the npm is around 436 mb. I would like to know is there a way to skip the npm install and already have the modules setup or something? Can I just remove node_modules/ from gitignore?

Thanks, Ara

0 likes
3 replies
toniperic's avatar

@Ara well yeah, you could... but that's considered to be bad practice.

Disk space is really cheap nowadays... can't you just buy an extra 0.5GB of disk space?

Ara's avatar
Level 3

Hi,

yeah I can. I just figured it was not normal for npm to have a 400+ mb hit on the ram...

leon13's avatar

Is it not possible to install your node modules on your server outside of the project root? That way you can just keep package.json in git

Please or to participate in this conversation.