-
Notifications
You must be signed in to change notification settings - Fork 20
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
ENOENT error on Windows #19
Comments
What version of node? |
Node.js v9.7.1 |
Ok so I had to pull the execSync polyfill due to a security issue reported in #16, will have to look into alternatives for windows, at least getting this running on the cli. Apologies, for windows I recommend continuing to use 4.x for now. |
Feel free to do some investigation and send a PR, might be a few days until I get around to looking at it. |
I think that on Windows, only executables (.exe) are spawn-able without extension name. Here is a test script: async function test() {
const {spawn} = require("child_process");
const eventToPromise = require("event-to-promise");
let p;
p = spawn("where", ["web-ext"], {stdio: "inherit"});
await eventToPromise(p, "exit");
p = spawn("where.exe", ["web-ext"], {stdio: "inherit"});
await eventToPromise(p, "exit");
p = spawn("web-ext", ["--version"], {stdio: "inherit"});
try {
await eventToPromise(p, "exit");
} catch (err) {
console.log("spawn error", err);
}
p = spawn("web-ext.cmd", ["--version"], {stdio: "inherit"});
await eventToPromise(p, "exit");
p = spawn("web-ext", ["--version"], {stdio: "inherit", shell: true});
await eventToPromise(p, "exit");
p = spawn("web-ext", ["--version"], {stdio: "inherit", shell: true, env: {pathext: ";"}});
try {
await eventToPromise(p, "exit");
} catch (err) {
console.log("spawn error", err);
}
}
test();
To correctly spawn a Also note that, by spawning through shell, even the command isn't found, the child process (the shell process i.e. cmd.exe) is spawned successfully. I would like to add Lines 54 to 61 in 03d91cb
What do you think? |
I am too facing the same issue. Posting the error log here.
|
@eight04 so hang on, does adding |
@timoxley Yes, it does. diff --git a/index.js b/index.js
index c7925c6..5d79520 100644
--- a/index.js
+++ b/index.js
@@ -57,6 +57,7 @@ function augmentOptionsSync (options) {
var env = Object.create(options.env)
env[npmPath.PATH] = newPath
options.env = env
+ options.shell = true
return options
}
Also the test failed on Windows:
|
Any ideas on this one? I can support in pushing this forward. |
* fix: make codegen more robust * fix: codegen, improve error messages * fix: codegen, downgrade npm-run to support windows * fix: codegen, ignore npm-run in renovate bot npm-run 5.x is broken on windows we don't want to accidently merge it unless timoxley/npm-run#19 is resolved. * fix: codegen, improve error message for graphql-binding * fix lint
npm-run 5.x is broken on windows timoxley/npm-run#19
npm-run 5.x is broken on windows timoxley/npm-run#19
npm-run 5.x is broken on windows timoxley/npm-run#19
It works fine with v4.x.
The text was updated successfully, but these errors were encountered: