Open markb-trustifi opened 4 years ago
Interesting, what do you think needs to be changed on our end for this to start working?
Can you have cache folder inside the node_modules/pwsh/dist
instead of the $HOME/.npm-pwsh
?
We keep the cache in a shared location since pwsh
is pretty big when extracted, so we don't want to be making multiple copies. I think that'll need to remain as the default behavior, but theoretically other behaviors are possible. Someone would need to send us a pull request which somehow allows the installation location to be customized.
Perhaps it can be exposed as a JS API or bin script which can be called in your own postinstall script to extract pwsh
to a custom directory. get-pwsh ./.cache/pwsh
. This won't put the binaries on your PATH but should be good enough. If we expose an API, it also allows other modules to consume the API, and those modules can put binaries on the PATH.
@cspotcode I found a solution/workaround, I just run bash script with all commands in a main project's postinstall
event and it is not deleted by Heroku.
The installation script works well in local installation but fails to install powershell on Heroku dyno. First of all, it installs it on Heroku out of the box, but probably deletes it immediately after the installation:
It says that "/app/.npm-pwsh" doesn't exist:
cannot access '/app/.npm-pwsh': No such file or directory
When I run the installation manually:
It creates the ".npm-pwsh" folder with correct permissions and prints the line:
Downloading Powershell archive from https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-x64.tar.gz to /app/.npm-pwsh/powershell-6.1.0-linux-x64.tar.gz...
.After that it stops executing.