cli-progress未在typescript nodejs 16上显示

rhfm7lfc  于 2023-05-06  发布在  Node.js
关注(0)|答案(1)|浏览(107)

cli-progress未显示在typescript nodejs 16上。我做错了什么?
代码

import cliProgress from "cli-progress";    

export const UpdateTags = (games:any[]) => {
        const bar1 = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
        bar1.start(games.length, 0);
    
        games.forEach((game, idx) => {
            game.tag = "game " + idx;
            bar1.update(idx);
        });
    
        bar1.stop();
    };

package.json

"dependencies": {
    "cli-progress": "^3.11.1",
  },
  "devDependencies": {
    "@types/cli-progress": "^3.11.0",
  },
xqnpmsa8

xqnpmsa81#

我也遇到了同样的问题。尝试以下操作:

import { SingleBar } from 'cli-progress'

相关问题