意外令牌(6:6) [英] Unexpected token (6:6)

查看:67
本文介绍了意外令牌(6:6)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试生成业务网络存档,但是在运行composer archive create -t dir -n .

I am trying to generate a business network archive but I am getting the following error while running composer archive create -t dir -n .

Creating Business Network Archive
Looking for package.json of Business Network Definition

SyntaxError: Failed to parse /Users/xxxx@xxxx.com/fabric-tools/tutorial-network/lib/logic.js: Unexpected token (6:6)

Command failed

意外令牌(6:6)? logic.js的内容如下:

Unexpected token (6:6)? the content of the logic.js are below:

cat lib/logic.js
/**
* Track the trade of a commodity from one trader to another
* @param {org.acme.mynetwork.Trade} trade - the trade to be processed
* @transaction
*/
async function tradeCommodity(trade) {
    trade.commodity.owner = trade.newOwner;
    let assetRegistry = await getAssetRegistry('org.acme.mynetwork.Commodity');
    await assetRegistry.update(trade.commodity);
}

推荐答案

composer v0.16.x中,不支持asyncES6关键字.有一个问题.您可以在此处进行检查.如果要使用这些关键字,则需要将composer升级到v0.17.4或更高版本.

In composer v0.16.x, async and ES6 keywords are not supported. There is an issue with it. You can check here. If you want to use these keywords you need to upgrade composer to v0.17.4 or higher.

这篇关于意外令牌(6:6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆