Is there a way to npm login when using "flyctl launch"?

I 'm trying to deploy a node.js (express) app.
My package.json contains a private npm package. Obviously a 401 error pop ups when I 'm trying to deploy.
Any solution?

You’d need to switch to flyctl deploy --local-only <args> (ref) when publishing your app to Fly. You should exec this command from a system that has access to npm private repos. Once the docker image is built, flyctl would auto-push it to Fly’s registry from where things should work as usual.

Thanks for your reply.
So I can only do this via docker is what you 're saying? I was trying to publish an npm app via flyctl launch

For apps, Fly only works with docker images. So every Fly app has to be using docker one way or the other, even if it isn’t Docker that runs in prod.

Try the --local-only switch when you flyctl deploy and see if that works?