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:
vue-cli-service electron:servenpm 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)
This relative module was not found:
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
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:
That fixed my issue.