[BUG] Tar upgrade from 6.1.0 to 6.1.9/6.1.10 throws error
Hello,
I am trying to upgrade tar version. However, getting this error
TypeError: Cannot destructure property isAbsolute of 'undefined' or 'null'.
5 | import * as tmp from "tmp";
6 | // import * as tar from "tar";
> 7 | const tar = require("tar");
Could anybody provide some direction?
What is the context in which you are loading tar? Is this a node program?
isAbsolute is destructured from require('path'), which should definitely not be undefined or null.
Thanks for the reply @isaacs. Yes, it is a node program. The thing is I am trying to upgrade tar version from 6.1.0 to 6.1.1+, and yarn test fails with the above error
Can you add a line in there like console.log(require("path")) to show what it's returning?
Also, the full stack trace from the error would be helpful.
My hunch is that somehow require('path').win32 isn't set, so the destructuring in ib/strip-absolute-path.js is the problem. What does node -v output?
Hi @psxpa3 were you able to resolve this issue? I am trying to update tar to the same version and facing the same issue.
Will reopen when the questions above are answered.
@isaacs I am seeing similar issues as well. Here are some related information:
Error trace:
Dependencies:
My file:
Node version: node: '16.18.0'
It would be really helpful if you could point me to the right direction! Thank you so much!