Cannot install certain NPM package inside a machine

When I ssh into a machine with fly ssh console then try to install for example prisma with npm npm i prisma it starts pulling the package from the registry and then the process just gets Killed.

Anyone know what could the problem be? I’m suspecting this is to my machine/memory being small and couldn’t handle the installation so it just kills the npm process, maybe?

edit: the current workout is adding prisma in my package.json and then redeploy with fly deploy (fast) that somehow solved my issues. but Im still wondering if experience could be better and what is the problem with just installing whatever package I want when ssh-in.

I wouldn’t say it’s a workaround, that’s the correct way to solve it. If you install things via ssh, they’ll be gone the next time you do a deploy.

1 Like

Yes I know, but maybe its what I want? sometimes you just want to debug something very quickly by install a package then once you solve the problem you just remove the package or it just gets removed on it’s own on my next deploy.
the current workaround results into a kinda small problem which I don’t want that package save on package.json. does that make sense?

I think you already identified the likely cause: memory being small.

You can scale your machine to have more memory using flyctl scale memory · Fly Docs

As a slower alternative you can create a swapfile which will enable virtual memory. This requires changes to your Dockerfile and either the creation or additions to your entrypoint script. If you are using a Dockerfile provided by fly.launch, these changes can be made using:

npx dockerfile --swap=512M

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.