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

编程入门 行业动态 更新时间:2024-10-09 02:25:44

不建议使用的警告:像const uuidv5一样的深层需求= require('uuid / v5');从节点js中的uuid@7.x开始不<a href=https://www.elefans.com/category/jswz/34/1770308.html style=推荐使用]] <<"/>

不建议使用的警告:像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('uuid / v5');从节点js中的uuid@7.x开始不推荐

本文发布于:2024-05-07 12:57:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1756345.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:推荐使用   节点   需求   建议   uuid

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!