Ibm cloud 在OpenWhisk中创建包操作时,调用失败并显示错误消息

Ibm cloud 在OpenWhisk中创建包操作时,调用失败并显示错误消息,ibm-cloud,openwhisk,ibm-cloud-functions,Ibm Cloud,Openwhisk,Ibm Cloud Functions,我将按照OpenWhisk文档中的示例创建一个新的包操作,详细说明 运行wsk action invoke步骤,平台将返回调用错误消息 [10:57:58 /tmp/workshop]$ wsk action invoke --blocking --result packageAction --param lines '[ "and now", "for something completely", "different" ]' { "error": "Initialization ha

我将按照OpenWhisk文档中的示例创建一个新的包操作,详细说明

运行
wsk action invoke
步骤,平台将返回调用错误消息

[10:57:58 /tmp/workshop]$ wsk action invoke --blocking --result packageAction --param lines '[ "and now", "for something completely", "different" ]' { "error": "Initialization has failed due to: SyntaxError: Invalid or unexpected token at NodeActionRunner.init (/nodejsAction/runner.js:79:29) at doInit (/nodejsAction/src/service.js:134:31) at initCode (/nodejsAction/src/service.js:80:24) at /nodejsAction/app.js:62:13 at Layer.handle [as handle_request] (/nodejsAction/node_modules/express/lib/router/layer.js:95:5) at next (/nodejsAction/node_modules/express/lib/router/route.js:131:13) at Route.dispatch (/nodejsAction/node_modules/express/lib/router/route.js:112:3)\n at Layer.handle [as handle_request] (/nodejsAction/node_modules/express/lib/router/layer.js:95:5)\n at /nodejsAction/node_modules/express/lib/router/index.js:277:22\n at Function.process_params (/nodejsAction/node_modules/express/lib/router/index.js:330:12)" } [10:57:58/tmp/workshop]$wsk操作调用--阻塞--结果包操作--参数行“[”和“现在”,“对于完全不同的东西”,“不同的”]” { “错误”:“初始化失败,原因是:SyntaxError:无效或意外的令牌。” 在NodeActionRunner.init(/nodejsAction/runner.js:79:29) 在doInit(/nodejsAction/src/service.js:134:31) 在initCode(/nodejsAction/src/service.js:80:24) at/nodejsAction/app.js:62:13 在Layer.handle[作为handle_请求](/nodejsAction/node_modules/express/lib/router/Layer.js:95:5) 下一步(/nodejsAction/node_modules/express/lib/router/route.js:131:13) at Route.dispatch(/nodejsAction/node\u modules/express/lib/router/Route.js:112:3)\n at Layer.handle[as handle\u request](/nodejsAction/node\u modules/express/lib/router/Layer.js:95:5)\n at/nodejsAction/lib/router/index.js:277:22\n at Function.process\n参数(/nodejs/nodejs/node\u modules/express/lib/router/index.js:330:12)” }
怎么了

包操作是平台的一项新功能

确保您必须使用最新版本才能支持此功能。使用较旧版本的cli部署包操作时,可能会发生此错误

您可以使用以下命令验证正在运行的CLI版本

[14:49:21 /tmp/workshop]$ wsk property get whisk auth xxxx:xxx whisk API host openwhisk.ng.bluemix.net whisk API version v1 whisk namespace user@host.com whisk CLI version 2016-10-24T11:55:02+00:00 whisk API build 2016-10-24T12:04:22Z whisk API build number whisk-build-1260 [14:49:21/tmp/workshop]$wsk property get 搅拌授权xxxx:xxx whisk API主机openwhisk.ng.bluemix.net 惠斯克API版本v1 whisk命名空间user@host.com whisk CLI版本2016-10-24T11:55:02+00:00 惠斯克API构建2016-10-24T12:04:22Z whisk API构建编号whisk-build-1260
确保CLI版本与上述版本匹配或大于上述版本。软件包操作是平台的一项新功能

确保您必须使用最新版本才能支持此功能。使用较旧版本的cli部署包操作时,可能会发生此错误

您可以使用以下命令验证正在运行的CLI版本

[14:49:21 /tmp/workshop]$ wsk property get whisk auth xxxx:xxx whisk API host openwhisk.ng.bluemix.net whisk API version v1 whisk namespace user@host.com whisk CLI version 2016-10-24T11:55:02+00:00 whisk API build 2016-10-24T12:04:22Z whisk API build number whisk-build-1260 [14:49:21/tmp/workshop]$wsk property get 搅拌授权xxxx:xxx whisk API主机openwhisk.ng.bluemix.net 惠斯克API版本v1 whisk命名空间user@host.com whisk CLI版本2016-10-24T11:55:02+00:00 惠斯克API构建2016-10-24T12:04:22Z whisk API构建编号whisk-build-1260 确保CLI版本与上述版本匹配或大于上述版本。