R
Railway13mo ago
SDCore

Error: no such file or directory - what's the file structure?

Hi! I'm trying to access locally stored images in my Node project, under /images/. I've tried both process.cwd() and __dirname, but they have the same result of not being able to find the images on railway. Locally on Windows 11 it works fine, but in Railway, it errors
[Error: ENOENT: no such file or directory, stat '/app/images/nonRanked/Duos.png']
[Error: ENOENT: no such file or directory, stat '/app/images/nonRanked/Duos.png']
Am I doing something wrong? I feel like I'm doing something wrong. The code in question is just:
attachment: `${process.cwd()}/images/nonRanked/${mode}.png`,
attachment: `${process.cwd()}/images/nonRanked/${mode}.png`,
Solution:
Nevermind, this was simply a product of me not realizing the image names were wrong :) Carry on
Jump to solution
3 Replies
Percy
Percy13mo ago
Project ID: b2bc734b-3a33-43ab-8708-b48b248f39f0
SDCore
SDCore13mo ago
b2bc734b-3a33-43ab-8708-b48b248f39f0
Solution
SDCore
SDCore13mo ago
Nevermind, this was simply a product of me not realizing the image names were wrong :) Carry on