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

Don't rely on presence of process.env.Path to detect windows #34

Closed
mkmik opened this issue May 25, 2016 · 1 comment
Closed

Don't rely on presence of process.env.Path to detect windows #34

mkmik opened this issue May 25, 2016 · 1 comment

Comments

@mkmik
Copy link

mkmik commented May 25, 2016

I noticed I couldn't install many npm packages because of:

npm ERR! not found: git

Digging deeper I noticed it's because of:

var pathEnv = opt.path || process.env.Path || process.env.PATH || ''

I have an env var on linux called Path (because it's needed by wine), so that is what gets split
I guess it would be better to check for the env var appropriate for the detected OS instead.

@isaacs
Copy link
Contributor

isaacs commented May 26, 2016

Environs are path-insensitive on Windows anyway, so this should be unnecessary. Probably better to just drop the check for Path since it's returned by env.PATH on Windows, and meaningless on Unix?

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

2 participants