使用多模式时出现节点 globby 错误

Node globby error while using multi patterns

我使用的节点 glob 运行正常。 我将它用于一个文件夹1,如下所示

      glob('folder1/*.js'), function(err, files){
        if (err) {
            console.log('Not able to get files from folder: ', err);
        } else {
            files.forEach(function (file) {

https://github.com/isaacs/node-glob

现在我也想从 folder2 中读取一个镜头,我尝试像下面这样使用 globby,但我得到了错误

    globby(['folder1/*.js','folder2/*.js']).then( function(err, files){
        if (err) {
            console.log('Not able to get files from folder: ', err);
        } else {
            //Get plugin configuration & provided actions
            files.forEach(function (file) {

https://github.com/sindresorhus/globby

在这种情况下,文件以 undfiend 的形式出现,我不知道为什么会出错

尝试从 then 回调中删除 err 参数。使用 catch 来处理错误 globby(['folder1/*.js','folder2/*.js']).then( function(files){...}).catch(function(err){...})