Skip to content

cann't include exe file #141

Open
Open
@Cupcc

Description

@Cupcc

What version of pkg are you using?

6.3.2

What version of Node.js are you using?

22.14.0

What operating system are you using?

windows11

What CPU architecture are you using?

intel 14700kf

What Node versions, OSs and CPU architectures are you building for?

node22-win-x64

Describe the Bug

After pkg the project, the program cannot find the ffmpeg.exe file when running
"assets": [
"node_modules/ffmpeg-static/ffmpeg.exe"
],

Expected Behavior

include ffmpeg.exe and tell me the correct path when running time.

To Reproduce

function code

const ffmpeg = require('fluent-ffmpeg');
let ffmpegPath = require('ffmpeg-static');
logger.info(`running on port ${process.env.PORT}`);
if (process.env.NODE_ENV === 'production') {
  // Check if resourcesPath is defined and try to join the correct path
  ffmpegPath = path.join(__dirname, '../../node_modules/ffmpeg-static/ffmpeg.exe');
} else {
  logger.info('Not running from a pkg binary. Using default ffmpeg-static path.');
}

logger.info('FFmpeg Path:', ffmpegPath);
ffmpeg.setFfmpegPath(ffmpegPath);

package.json

"assets": [
      "node_modules/ffmpeg-static/ffmpeg.exe"
    ],

pkg . --debug
search 'ffmpeg.exe' and didn't see it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions