流浪汉安装问题-未满足的依赖关系

时间:2019-03-14 09:21:19

标签: ubuntu installation vagrant

我正在尝试在Ubuntu桌面18.04.2上安装vagrant,但出现以下错误

const mongoose1 = require("mongoose");
const mongoose2 = require("mongoose");

const dbUrl1 = "mongodb://localhost:27017/db1";
const dbUrl2 = "mongodb://localhost:27017/db2";

mongoose1.connect(dbUrl1);
mongoose2.connect(dbUrl2);

let allDb = [mongoose1, mongoose2];

function waitEvent(event) {
  return new Promise((resolve, reject) => {
    event.on("connected", resolve);
    event.on("error", reject);
  });
}

async function prepareAllDb() {
  let pendingProcess = [];

  allDb.forEach(database => {
    // mongoose put their event on mongoose.connection
    pendingProcess.push(waitEvent(database.connection));
  });

  await Promise.all(pendingProcess);

  return;
}

prepareAllDb().then(() => {
  console.log("All databases are ready to use");

  // Run your server in here
});

如何解决此问题?有任何线索吗?

1 个答案:

答案 0 :(得分:0)

让Ubuntu修复未满足的依赖关系和损坏的软件包的命令是

~ sudo apt-get install -f

Ubuntu将在运行命令时尝试自行修复。完成后,您可以通过再次运行命令来测试其是否有效。