当前位置: 代码迷 >> 综合 >> 使用uuid报错:`const uuidv1 = require('uuid/v1');` is deprecated as of uuid@7.
  详细解决方案

使用uuid报错:`const uuidv1 = require('uuid/v1');` is deprecated as of uuid@7.

热度:13   发布时间:2023-12-22 05:38:00.0

使用uuid报错:Deep requiring like `const uuidv1 = require('uuid/v1');` is deprecated as of uuid@7.x. Please require the top-level module when using the Node.js CommonJS module or use ECMAScript Modules when bundling for the browser. 

import uuidv1 from 'uuid/v1'改为import { v1 as uuidv1 } from 'uuid'即可

  相关解决方案