I have been struggling for a few days getting my NodeJS apps built and deployed.
I’ve reached out to support a few times but didn’t get any helpful reply.
My app crashes during build with the following:
error building image:
error building stage:
failed to optimize instructions:
failed to get files used from context:
failed to get fileinfo for /.app_platform_workspace/settings.json:
lstat /.app_platform_workspace/settings.json:
no such file or directory
This is the Git repo I’m trying to run: https://github.com/healzer/DiscordEarsBot
The message indicates that settings.json is missing, which is correct however the only way I use this file in the code is here:
const SETTINGS_FILE = 'settings.json';
function loadConfig() {
if (fs.existsSync(SETTINGS_FILE)) {
const CFG_DATA = JSON.parse( fs.readFileSync(SETTINGS_FILE, 'utf8') );
...
} else {
...
}
}
loadConfig()
Due to the if-condition it shouldn’t read that settings file, and shouldn’t crash if it is missing. I’m assuming something is broken on DO’s side. Because I deploy this repo on Heroku and on my Ubuntu droplet without any problems.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.