After building an executable, the .exe works when run from the original build path. However, when I move the build to a new folder, the application breaks. See error below.
The index.js
file that it cannot find is the entry file used in the build script. The reason it works on the original build folder, I presume, is because the .exe can find it in its original location when the build command was run.
Here is the build script.
const { compile } = require('nexe')
const { version } = require('./package.json')
const inputAppName = '../index.js'
const outputAppName = `../build/InfinityDataBank_v${version}`
compile({
input: inputAppName,
output: outputAppName,
build: true,
clean: false,
verbose: false
}).then((err) => {
if (err) throw err
console.log('success')
})
The reason for the ..
is because I run the compile script from within the build folder to be able to have the script work in this location. I have tried the same from the project root with no positive results.
Thanks in advance