cspotcode / cspotcode/npm-pwsh

Cannot install PWSH on Heroku Node.js dyno

Open
#22 4 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
12
Forks
5
PR merge metrics
No merged PRs in 30d

Description

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:
```
> pwsh@0.2.0 postinstall /tmp/build_2d8a9620_/node_modules/pwsh
> node ./npm_lifecycle_postinstall.js

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...
Download finished.
Extracting archive to /app/.npm-pwsh/powershell-6.1.0-linux-x64...
Extracted to /app/.npm-pwsh/powershell-6.1.0-linux-x64
Symlinking from /tmp/build_2d8a9620_/node_modules/pwsh/bin/pwsh to /app/.npm-pwsh/powershell-6.1.0-linux-x64/pwsh (via /tmp/build_2d8a9620_/node_modules/pwsh/bin/pwsh)...
Done!
```

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:
```
spawnSync('chmod 777 ' + __dirname + '/../../node_modules/pwsh/dist/npm_lifecycle_postinstall.js', [], {shell: true});
spawnSync('node', [__dirname + '/../../node_modules/pwsh/dist/npm_lifecycle_postinstall.js']);
```

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.