小编ace*_*roo的帖子

在JS中安装npm uuid后无法调用uuid函数

在JS中安装npm uuid后,我无法调用uuid函数,使用电子

这是我安装时终端上的消息,我不知道这是否正确安装

$ npm install uuid
npm WARN pemrograman_visual2@1.0.0 No description
npm WARN pemrograman_visual2@1.0.0 No repository field.

+ uuid@7.0.3
updated 1 package and audited 120 packages in 1.746s

2 packages are looking for funding
  run `npm fund` for details

found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
Run Code Online (Sandbox Code Playgroud)

这是我调用函数的地方

ipcMain.on("appointment:create", (event, appointment) => {
    appointment["id"] = uuid();
    appointment["done"] = 0;
    allAppointment.push(appointment);

    CreateWindow.close();

    console.log(allAppointment);
});
Run Code Online (Sandbox Code Playgroud)

但是当我使用 $npm start 运行程序时,它说 TypeError: uuid is …

javascript uuid node.js electron

-1
推荐指数
1
解决办法
2221
查看次数

标签 统计

electron ×1

javascript ×1

node.js ×1

uuid ×1