Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powershell issues #34

Open
nprail opened this issue Nov 11, 2019 · 8 comments
Open

Powershell issues #34

nprail opened this issue Nov 11, 2019 · 8 comments
Labels
bug Something isn't working

Comments

@nprail
Copy link
Member

nprail commented Nov 11, 2019

npm-audit-html doesn't seem to work in Powershell. Piping npm audit --json into npm-audit-html does not actually work. For some reason, there is no stdin. The process just silently exits.

Also, reading directly from a JSON files doesn't work in Powershell (e.g. npm audit --json > audit.json; npm-audit-html -i audit.json). The readJson function fails due to charector encoding issues.

@nprail nprail added the bug Something isn't working label Nov 11, 2019
@AdrianoCahete
Copy link

Seems to be working here, with PowerShell 5.1 (Windows 10 default):
image

Also, reading directly from a JSON files doesn't work in Powershell

Yes, this really fails.

@nprail
Copy link
Member Author

nprail commented Nov 17, 2019

@AdrianoCahete Interesting. What terminal are you using? Also, what Node version?

@AdrianoCahete
Copy link

It's PowerShell running inside cmder.

λ node --version
v11.0.0

@nprail
Copy link
Member Author

nprail commented Nov 20, 2019

Interesting. I'm running the exact same build of Powershell as you so it must be the terminal emulator that is breaking it for me. I'm using Windows Terminal but I also tried the default terminal.

I'm running Node v12.13.0.

It looks like this is really two separate issues. I'll be digging into it when I have time (hopefully sometime before the end of the week).

@jonizen
Copy link

jonizen commented Jun 9, 2021

PowershelI is a special cookie! I just added “>” and it works.

npm audit --json > npm-audit-html

@nprail
Copy link
Member Author

nprail commented Jun 9, 2021

@jonizen That seems to just write the JSON to a file named npm-audit-html for me.

@iPlexor
Copy link

iPlexor commented Jul 20, 2021

@jonizen That seems to just write the JSON to a file named npm-audit-html for me.

Same here 😢

Edit: The regular pipe command worked fine in the command prompt.

@davidmdem
Copy link

PowerShell won't support piping output from one non-PowerShell command to another. You can still execute the cmd version of the command via PowerShell by passing it as a parameter to cmd.

cmd /c 'npm audit --json | npm-audit-html'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants