-
Notifications
You must be signed in to change notification settings - Fork 51
process.env.PATH not set correctly on windows #91
Copy link
Copy link
Closed
Description
Hi guys,
I just played a bit with the "which" module from npm which uses the process.env.PATH variable to find a executable file, but it couldn't find cmd.exe or java.exe on my system because process.env.PATH was empty. After I had a deeper look into this I found found that the PATH variable on my windows system is called "Path" and not "PATH".
var which = require("which");
// does not find java
which("java", function(err, result) {
if (err) {
return console.log(err);
}
console.log(result);
});
process.env.PATH = process.env.Path;
// now it works
which("java", function(err, result) {
if (err) {
return console.log(err);
}
console.log(result);
});
Reactions are currently unavailable