ES6 Promise execution order problem

an execution chain of Promise, but it is found that the order of execution is not in the order of then .

   

readDir the conlose in the method is executed before the createProjectDir method.

am I missing something?

Es6
Aug.17,2021

const createProjectDir = (newProjectRoot) = > {

return new Promise((resolve,reject)={
  Fs.mkdir(newProjectRoot,err=>{
    if(err == null){
        console.log(1111111111111)
        resolve(generateRoot);
    }else{
        console.log(2222222)
        reject(err);
    }
})

};

try this because your promise is returned asynchronously


createProjectDir is asynchronous and no promise is returned

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dcaf-e910.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dcaf-e910.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?