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

process.umask() is not available inside worker thread #9

Closed
SimenB opened this issue Jan 22, 2019 · 3 comments
Closed

process.umask() is not available inside worker thread #9

SimenB opened this issue Jan 22, 2019 · 3 comments

Comments

@SimenB
Copy link

SimenB commented Jan 22, 2019

This line makes the worker throw instantly:

mode: 0o777 & (~process.umask()),

// make-dir.js
require('make-dir');
// make-dir-worker.js
const {Worker} = require('worker_threads');

new Worker(require.resolve('./make-dir'));
$ node -v
v10.14.1
$ node --experimental-worker make-dir-worker.js

events.js:167
      throw er; // Unhandled 'error' event
      ^
TypeError: process.umask is not a function
    at Object.<anonymous> (/Users/simen/Development/jest/node_modules/make-dir/index.js:7:26)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/simen/Development/jest/make-dir.js:1:63)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
Emitted 'error' event at:
    at Worker.[kOnErrorMessage] (internal/worker.js:334:10)
    at Worker.[kOnMessage] (internal/worker.js:344:37)
    at MessagePort.Worker.(anonymous function).on (internal/worker.js:281:57)
    at MessagePort.emit (events.js:182:13)
    at MessagePort.onmessage (internal/worker.js:86:8)
@SimenB
Copy link
Author

SimenB commented Jan 22, 2019

Sorta related (but wouldn't fix it): nodejs/node#25448

@SimenB
Copy link
Author

SimenB commented Jan 22, 2019

Ergh, I should have checked the links: nodejs/node#25526

Maybe we can call this fixed then?

@sindresorhus
Copy link
Owner

Yup

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