admin管理员组

文章数量:815041

不建议使用的警告:像const uuidv5一样的深层需求= require('uuid / v5');从节点js中的uuid@7.x开始不推荐使用]] <<

如何解决此问题?

(node:2144)DeprecationWarning:从[[email protected]]开始不赞成使用const uuidv5 = require('uuid/v5');之类的深度要求。使用Node.js CommonJS模块时,请使用顶级模块;为浏览器绑定时,请使用ECMAScript模块。有关更多信息,请参见。TypeError:值必须为字节数组

const uuid=require("uuid/v5") const {product,token}=req.body; console.log(product) console.log(product.price) const idempontencyKey=uuid() stripe.customers.create({ email:token.email, source:token.id }).then(customer=>{ stripe.charges.create({ amount:10, currency:'pkr', customer:customer.id, receipt_email:token.email, },{idempontencyKey}) }) .then(result=>res.status(200).json(result)) .catch(err=>console.log(err)) })

如何解决这个问题? (节点:2144)DeprecationWarning:像const uuidv5一样的deep require = require('uuid / v5');从[email protected]开始不推荐使用。使用节点时,请使用顶层模块。...
回答如下:

本文标签: 不建议使用的警告像const uuidv5一样的深层需求 require(39uuidv539)从节点js中的uuid7x开始不推荐使用 ltlt