promise-it-wont-hurt icon indicating copy to clipboard operation
promise-it-wont-hurt copied to clipboard

Use of deprecated os.tmpDir()

Open BinaryEnigma01 opened this issue 4 years ago • 8 comments

When trying to take a look at any exercise besides the very first one, I got:

/usr/local/lib/node_modules/promise-it-wont-hurt/node_modules/@timothygu/workshopper-wrappedexec/wrappedexec.js:16
  var dataPath = path.join(os.tmpDir(), '~workshopper.wraptmp.' + process.pid)
                              ^

TypeError: os.tmpDir is not a function

After some quick googling, found that os.tmpDir() is and has been deprecated for a while now, and os.tmpdir() should be used instead. Upon enacting this substitution, everything worked just fine.

Recommendation: require https://github.com/workshopper/workshopper-wrappedexec instead of outdated fork https://github.com/TimothyGu/workshopper-wrappedexec

BinaryEnigma01 avatar Dec 14 '20 10:12 BinaryEnigma01

(Oops just noticed there are more issues with this, should have left a comment instead)

BinaryEnigma01 avatar Dec 14 '20 10:12 BinaryEnigma01

got same issue as you!

abmdni avatar May 14 '21 15:05 abmdni

me too

Tania-Y avatar Sep 29 '21 10:09 Tania-Y

It still throwing the error :(

k-garrido avatar Nov 17 '21 16:11 k-garrido

To solve this problem you have to change line 13 of the file [node_path]/node_modules/promise-it-wont-hurt/node_modules/@timothygu/workshopper-wrappedexec/wrappedexec.js

os.tmpDir()

change this for that

os.tmpdir()

Cabanesdev avatar Mar 22 '22 09:03 Cabanesdev

You could use nvm to temporarily switch to an older version of Node.

qadzek avatar Apr 26 '22 12:04 qadzek

Line 9 : os.tmpDir = os.tmpdir; Line 12 : var dataPath = path.join(os.tmpDir(), '~workshopper.wraptmp.' + process.pid)


How do we edit it now to make sure that we don't face any issues ?

msnitish avatar May 07 '23 07:05 msnitish

thanks a lot bro

A-SaiKrishna avatar Nov 27 '23 06:11 A-SaiKrishna