unzipper
unzipper copied to clipboard
Error: EACCES: permission denied, mkdir
Hey, I am trying to simply unzip a zip file. However, I am getting this permission denied issue. The odd thing is that if I loook at the permission of the folder I set with chmod -R 777
see resulting perm drwxrwxrwx 4 user user 4096 Aug 12 09:41 ejected
Here is the coding:
async function unpackZip(dependency: string) {
const directory = await unzipper.Open.file(resolve('./ejected/tmp', dependency + '.zip'))
console.log('Unpacking...', dependency)
if (!fs.existsSync('./ejected/' + dependency)) {
fs.mkdirSync('./ejected/' + dependency, { recursive: true })
}
directory.extract({ path: resolve('./ejected', dependency, '/') })
}