Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This relative module was not found: * ./lib-cov/fluent-ffmpeg in ./node_modules/fluent-ffmpeg/index.js #998

Open
3 tasks
lk220203006 opened this issue Apr 17, 2020 · 5 comments

Comments

@lk220203006
Copy link

Version information

  • fluent-ffmpeg version:fluent-ffmpeg@2.1.2
  • ffmpeg version:
  • OS:Mac

Code to reproduce

const ffmpeg = require('fluent-ffmpeg');

Electron + Vue 框架,在js中引用ffmpeg。
package.json中
"electron:serve": "vue-cli-service electron:serve",
在终端执行 npm run electron:serve 提示错误
ERROR Failed to compile with 1 errors 11:10:12

This relative module was not found:

  • ./lib-cov/fluent-ffmpeg in ./node_modules/fluent-ffmpeg/index.js
    ERROR Build failed with errors.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! ai-dev-platform@0.1.0 electron:serve: vue-cli-service electron:serve
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the ai-dev-platform@0.1.0 electron:serve script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/liukun/.npm/_logs/2020-04-17T03_10_12_322Z-debug.log
The terminal process terminated with exit code: 1
(note: if the problem only happens with some inputs, include a link to such an input file)

Expected results

Observed results

This relative module was not found:

  • ./lib-cov/fluent-ffmpeg in ./node_modules/fluent-ffmpeg/index.js

Checklist

  • I have read the FAQ
  • I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
  • I have included full stderr/stdout output from ffmpeg
@jmorino
Copy link

jmorino commented Jun 7, 2020

Same problem here (Electron + Vue + macOS + electron-builder).

I found that fork https://github.com/pietrop/ffmpeg-static-electron that should solve this issue, but the author doesn't seem to maintain it anymore.

@ghost
Copy link

ghost commented Jun 13, 2020

I had the same issue - Electron, vue/cli and electron-builder - and here's how I solved the issue:

In vue.config.js I added this to the webpack configuration in the plugins property:

const webpack = require('webpack');

module.exports = {
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        'process.env.FLUENTFFMPEG_COV': false
      })
    ]
  }
}

That fixed my issue.

@max-programming
Copy link

max-programming commented Apr 7, 2021

I tried the same thing but the Rollup approach and it's not working for me in Rollup. Can you suggest some way?
I am trying to bundle a nodejs app fully.

Command I ran: rollup -c --environment FLUENTFFMPEG_COV:false OR rollup -c --environment FLUENTFFMPEG_COV:0

@haoranisg
Copy link

修改 node_modules/fluent-ffmpeg/index.js
image

@princefishthrower
Copy link

@haoranisg does that fix the bundling issue, or is it just a suggestion?

@max-programming - I've reached the exact same point as you, trying to bundle a node package using this library with rollup and getting this error, did you every solve this or have a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants