Mix.install was added in order to improve work with single file scripts which obviously cannot define separate mix.exs file. It uses internal API to … let’s say simulate a project by pushing some data (like dependencies) and executes the script after those are fetched and compiled … in the temporary directory.
Anyway it’s not easy if you want to install dependencies after deployment. Firstly you do not have app like in dev environment, but a release(d app) in prod. Those are much different and simply adding more deps source code would not work or would cause another problems. You would need not only to send a released dependencies, but also update the app itself. Also the directory structure is not guaranteed to be the same across all environments, so even if you would use mix deps.get or any other dev tool the app may not even see new files. Not even saying that mix is not always available on prod machine. There are many other "but"s …
This function can only be called outside of a Mix project and only with the same dependencies in the given VM.
Note: this feature is currently experimental and it may change in future releases.
Source: Mix — Mix v1.20.2
It’s much more easier to release the application again with a new dependencies. I honestly do not see why you want to do this from command line.






















