Manage node_modules due to low disk space

The project in question:

I know there’s a lot of other posts regarding the same issue

I’m writing up a react app and trying to keep it in the glitch ecosystem. I’ve gotten backend support through MongoDB Atlas up and running.

The issue I’m running up against is react-scripts takes up about 150mb of the 200mb limit. It is in .gitignore and I can remove it, but once installing it the project halts. I’ve read through, and as far as I can see the limit of 200MB is fixed for free accounts, so is there any way besides the 24 hour limit increase?

Should I try to get a replacement for react-scripts or simply extract what I really need from the module? Any help would be really nice!

I did see this:

Projects have a limit of 200MB of disk space in the container. The contents of your project’s ‘/tmp’ directory currently don’t count towards that total, but those files are removed when the project restarts. By default your Node.js modules don’t count towards that total - there’s a separate 1GB limit for node modules. Plus, there’s an additional 512MB of assets storage space.

How do I access that 1GB limit?

I believe that the extra 1GB applies when you use pnpm to install modules, so maybe try running enable-pnpm in the console?


That was it, thank you Ben!

For anyone stumbling on this:

Use rm -rf node_modules and then use pnpm install
From then on, you can use pnpm install <module> --save and it’ll work just like npm itself.

As for running react scripts, I’ve found that pnpm run build and npm run build both work, so I’m not sure what changes here, I’ll be reading into it and hopefully update it as to which is best.