Google App Engine - Node.js - Error: ENOENT

35 Views Asked by At

I'm using Google App Engine running Node.js that is returning a null value in my Android Studio app. Logcat looks good, but the Google App Engine Console is returning an error:

Error: ENOENT: no such file or directory, mkdir '/foldername/foldername'

The applicable code in my index.js file is:

'''
app.post('/update-account', async (req,res)=>{
    //const dir = "./foldername/"foldername
    const dir = "/foldername/"+foldername
    try {
        fs.mkdirSync(dir, { recursive: true }, function(err) {
            if (err) {
              console.log(err)
            } else {
              console.log("New directory successfully created.")
            }
        }) 
'''

I think this may be a permissions error in Google App Engine??? The foldername is a variable based on account data. I've seen other similar posts about the ENOENT error and have tried several of the solutions and none have resolved the issue for me. Any thoughts are greatly appreciated!

1

There are 1 best solutions below

0
NoCommandLine On

Don't believe it will work for you because it seems you're trying to create a folder in the file system but Google App Engine standard doesn't support that (see documentation). You can only write to the tmp directory

Writing to local disk

Java 8, Java 11, Java 17, Node.js, Python 3, PHP 7.X, PHP 8.1, Ruby, Go 1.11, and Go 1.12+ have read and write access to the /tmp directory.