我刚开始使用Shopify,并尝试下单。根据Shopify API文档,这是我的代码:
const Shopify = require('@shopify/shopify-api');
const client = new Shopify.Clients.Rest('my-store.myshopify.com',
process.env.SHOPIFY_KEY);
module.exports.getShopifyOrderById = async (orderId) => {
return await client.get({
path: `orders/${orderId}`,
});
}
执行这段代码时,我遇到了以下错误:
TypeError: Cannot read properties of undefined (reading 'Rest')
const { Shopify } = require('@shopify/shopify-api');
- Tajs