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

Gscan Latest version not working #309

Closed
mskian opened this issue Apr 13, 2020 · 11 comments
Closed

Gscan Latest version not working #309

mskian opened this issue Apr 13, 2020 · 11 comments

Comments

@mskian
Copy link

mskian commented Apr 13, 2020

gscan latest package not working
when try to test end up with

gscan --fatal --verbose .
/usr/bin/env: invalid option -- 'S'
Try '/usr/bin/env --help' for more information.
gscan .
/usr/bin/env: invalid option -- 'S'
Try '/usr/bin/env --help' for more information.

Live-action - https://github.com/TryGhost/London/runs/576771741

issue on 3.5.1
3.4.0 works well

@naz
Copy link
Contributor

naz commented Apr 13, 2020

Hey @mskian, could you please provide the information on the environment (OS, node version, etc.) you are running the command in?

@mskian
Copy link
Author

mskian commented Apr 13, 2020

OS: ubuntu 18.04 LTS
Node: v10.20.0
ghost: 3.13.1
Ghost-CLI version: 1.13.1

Just run the gscan CLI test in the theme folder

@mskian
Copy link
Author

mskian commented Apr 13, 2020

I think due to this - 7954aee

@mskian
Copy link
Author

mskian commented Apr 13, 2020

gscan/bin/cli.js

#!/usr/bin/env node
const prettyCLI = require('@tryghost/pretty-cli');
const ui = require('@tryghost/pretty-cli').ui;
const _ = require('lodash');
const chalk = require('chalk');
const gscan = require('../lib');

I tried this
this will work

@ErisDS
Copy link
Member

ErisDS commented Apr 13, 2020

@daniellockyer can you do a little bit more looking into this to see if there's another method to get rid of the warning, and if you can't find one in an hour or so lemme know?

Last resort I'll try to refactor the output so the warning doesn't look like part of the gscan output

@daniellockyer
Copy link
Member

daniellockyer commented Apr 15, 2020

@ErisDS Can't find anything ☹️

https://www.xiaoru.li/post/disabling-node-warnings/ mentions the same issue and their recommendation:

If you only wanted to disable the warnings because you used the fs.promises API as I did, I would recommend you to wrap the original APIs in a promise manually next time to avoid the hassle, or simply sticking to util.promisify as well as the sync version of the APIs, instead of using this workaround.

@ErisDS
Copy link
Member

ErisDS commented Apr 16, 2020

Yeah - but we're not using the fs.promises API, a dependency 3 levels deep is :(

@ErisDS ErisDS changed the title Gscan Latest version Working Gscan Latest version not working Apr 16, 2020
@ErisDS
Copy link
Member

ErisDS commented Apr 16, 2020

I've raised this as an issue against Node.js: nodejs/node#32876

We obviously need this working on ubuntu, I'll take a look to see if I can minimize the impact of the warning.

@markmssd
Copy link

Ran into the same issue, glad I wasn't crazy! I had to downgrade to 3.4.1 to have it work.

@ErisDS
Copy link
Member

ErisDS commented Apr 20, 2020

After a bit of a back-and-forth, we've found an OS-agnostic solution using process.removeAllListeners()

Fix and release incoming!

@ErisDS ErisDS closed this as completed in 2f751df Apr 20, 2020
@markmssd
Copy link

Working with this fix, thank you @ErisDS !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants