如何在节点

我有此问题,我的机器上有以“ $ TPMAB”,“ $ TPMBC”,“ $ TPMCD”等开头的目录。我想删除这些目录中的子目录。我同时使用了rimraf和fs-extra npm库。他们没有给出任何错误。但是在运行之后,仍然可以看到子目录。

removeIncludedCommonFolders: function(coFolderPathsArr){

        coFolderPathsArr.forEach(folderPath => {

            let folderName = folderPath.substring(folderPath.lastIndexOf('/')+1);
            if(folderName.charAt(0) === '$'){
                var commonIncludedPath = path.join(folderPath,'includes',Config.COMMON_FOLDER_NAME);

//commonIncludedPath = Users/imadhushanka/Desktop/web/src/fef/$TpmUserL1/includes/common-autogenerated-new

                rimraf(commonIncludedPath,err => {
                    if (err) {
                        throw new Error(`Cannot remove folder at ${folderPath}.${err}`);
                    }
                });
            }
        });
}
hlw13781927235 回答:如何在节点

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3124982.html

大家都在问