const fs = require('fs');
const AdmZip = require('adm-zip');
//Path to the .bak file
const bakFilePath = 'C:\Users\Nikla\Documents\AdventureWorksDW2022.bak';
//Path to the output .zip file
const zipFilePath = 'C:\Users\Nikla\Documents\zip';
//Read the .bak file
const bakBytes = fs.readFileSync(bakFilePath);
//Create a new zip archive
const zip = new AdmZip();
zip.addFile('file.bak', bakBytes);
//Write the zip file to disk
zip.writeZip(zipFilePath);
console.log(`Conversion complete: ${zipFilePath}`);
< /code>
Если я запускаю этот код, я всегда получаю эту ошибку в TE Terminal
Сообщение об ошибке на изображении. < /p>
Результат терминала
Подробнее здесь: https://stackoverflow.com/questions/794 ... -something