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

Created on 17 Apr 2020  ·  3Comments  ·  Source: fluent-ffmpeg/node-fluent-ffmpeg

Version information

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! [email protected] electron:serve: vue-cli-service electron:serve
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] 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

Most helpful comment

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.

All 3 comments

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.

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elartix picture elartix  ·  5Comments

echo66 picture echo66  ·  3Comments

345ml picture 345ml  ·  6Comments

danielbanfield picture danielbanfield  ·  5Comments

epdev picture epdev  ·  3Comments