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

Support process.chdir.disabled #200

Closed
wants to merge 3 commits into from
Closed

Conversation

mischnic
Copy link
Contributor

@mischnic mischnic commented Nov 26, 2020

On more recent Node versions process.chdir.disabled is true in Workers (because that function isn't supported in worker threads). It was previously not copied over to the chdir wrapper.

Example (this issue causes an exception on Windows because moxystudio/node-cross-spawn#132 need to check for chdir.disabled):

// x.js
const {Worker} = require("worker_threads");
new Worker("./y.js");


// y.js
require('graceful-fs');
console.log(process.chdir.disabled, "should be true in a Worker"); // prints "undefined should ...."

const spawn = require('cross-spawn');
spawn('ps', [], {cwd: process.cwd()}) // this call fails on windows

polyfills.js Outdated Show resolved Hide resolved
Co-authored-by: Corey Farrell <git@cfware.com>
@mischnic mischnic changed the title Copy over process.chdir.disabled if set Support process.chdir.disabled Nov 27, 2020
polyfills.js Outdated Show resolved Hide resolved
Co-authored-by: Corey Farrell <git@cfware.com>
@isaacs isaacs closed this in 7b85570 Feb 5, 2021
@mischnic mischnic deleted the patch-1 branch February 5, 2021 19:48
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

Successfully merging this pull request may close these issues.

None yet

2 participants