最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

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

IT培训 admin 11浏览 0评论

不建议使用的警告:像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开始不推荐使用]] <<

如何解决此问题?

(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]开始不推荐使用。使用节点时,请使用顶层模块。...
回答如下:
发布评论

评论列表 (0)

  1. 暂无评论