distubejs / ytdl-core

YouTube video downloader in javascript.
MIT License
286 stars 50 forks source link

Error: EROFS: read-only file system, open '1723102820393-base.js' #78

Closed Namnp1521 closed 3 months ago

Namnp1521 commented 3 months ago

Describe the bug

i got this bug when download video by Firebase Cloud Function. Local is woking fine.

Error: EROFS: read-only file system, open '1723102820393-base.js' at Object.openSync (node:fs:596:3) at writeFileSync (node:fs:2322:35) at exports.saveDebugFile (/layers/google.nodejs.yarn/yarn_modules/node_modules/@distube/ytdl-core/lib/utils.js:301:3) at extractNTransform (/layers/google.nodejs.yarn/yarn_modules/node_modules/@distube/ytdl-core/lib/sig.js:170:15) at exports.extractFunctions (/layers/google.nodejs.yarn/yarn_modules/node_modules/@distube/ytdl-core/lib/sig.js:186:3) at /layers/google.nodejs.yarn/yarn_modules/node_modules/@distube/ytdl-core/lib/sig.js:18:29 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errno: -30, syscall: 'open', code: 'EROFS', path: '1723102820393-base.js'

Environment

skick1234 commented 3 months ago

It cannot save debug file due to folder/node permission.

Namnp1521 commented 3 months ago

It cannot save debug file due to folder/node permission.

so what can i do to fix this?

Namnp1521 commented 3 months ago

It cannot save debug file due to folder/node permission.

How can i disabled this code. Thanks. exports.saveDebugFile = (name, body) => { const filename =${+new Date()}-${name}; writeFileSync(filename, body); return filename; };