简体   繁体   English

npm安装azure-event-hubs node.js

[英]npm install azure-event-hubs node.js

I tried to set up a node.js to simulate inputs to an azure Event Hub. 我试图设置一个node.js来模拟输入到Azure事件中心的输入。

A) when i tried to install thru: 》npm install azure-event-hubs I got the warning message: A)当我尝试通过以下方式安装时:》 npm install azure-event-hubs我收到警告消息:

npm WARN deprecated crypto@0.0.3: This package is no longer supported. npm WARN不建议使用crypto@0.0.3:不再支持此软件包。 It's now a built-in Node module. 现在,它是内置的Node模块。 If you've depended on crypto, you should switch to the one that's built-in. 如果您依赖加密,则应切换到内置密码。

Does this mean it is still working? 这是否意味着它仍在工作? just a warningmessage? 只是警告消息?

B) As my susbequent node.js script failed to accept the connection string i copied from my Azure Event Hub: B)由于我的后续node.js脚本无法接受我从Azure事件中心复制的连接字符串:

Code: var EventHubClient = require('azure-event-hubs').Client; 代码:var EventHubClient = require('azure-event-hubs')。Client;

var connStr = 'Endpoint=sb://abrstrial.servicebus.windows.net/;SharedAccessKeyName=DeviceAccess;SharedAccessKey=Npb..................... var connStr ='Endpoint = sb://abrstrial.servicebus.windows.net/; SharedAccessKeyName = DeviceAccess; SharedAccessKey = Npb .....................

(errors) (错误)

E:\\Azure ML\\LAB04\\fitness_device\\node_modules\\azure-event-hubs\\lib\\client.js:92 throw new ArgumentError('Connection string doesn\\'t have EntityPath, or missing argument path'); E:\\ Azure ML \\ LAB04 \\ fitness_device \\ node_modules \\ azure-event-hubs \\ lib \\ client.js:92抛出新的ArgumentError('连接字符串没有EntityPath或缺少参数路径'); ^ ArgumentError: Connection string doesn't have EntityPath, or missing argument path at Function.EventHubClient.fromConnectionString (E:\\Azure ML\\LAB04\\fitness_device\\node_modules\\azure-event-hubs\\lib\\client.js:92:11) at Object. ^ ArgumentError:连接字符串没有EntityPath或Function.EventHubClient.fromConnectionString缺少参数路径(E:\\ Azure ML \\ LAB04 \\ fitness_device \\ node_modules \\ azure-event-hubs \\ lib \\ client.js:92:11)在对象。 (E:\\Azure ML\\LAB04\\fitness_device\\exercise.js:5:29) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:389:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:504:3 (E:\\ Azure ML \\ LAB04 \\ fitness_device \\ exercise.js:5:29)位于Object.Module._extensions..js(module.js:579:10)的Module._compile(module.js:570:32)在Module.loadMain(module.js:604:3)在try.ModuleLoad(module.js:446:12)在Module.load(module.js:446:12) 10)在启动时(bootstrap_node.js:149:9)在启动时(bootstrap_node.js:149:9)在bootstrap_node.js:504:3运行时

Would it be due to different access method to Azure classic vs ARM portal? 是由于对Azure经典门户还是ARM门户的访问方法不同? or it is a node.js compilation problem? 还是有一个node.js编译问题?

npm WARN deprecated crypto@0.0.3: This package is no longer supported. npm WARN不建议使用crypto@0.0.3:不再支持此软件包。 It's now a built-in Node module. 现在,它是内置的Node模块。 If you've depended on crypto, you should switch to the one that's built-in. 如果您依赖加密,则应切换到内置密码。

This SDK is currently in preview, and is maintained by Microsoft employees and external contributors in their free time. 该SDK当前处于预览状态,由Microsoft员工和外部贡献者在空闲时间维护。 For offical SDKs please see: 有关官方的SDK,请参阅:

  • Event Hubs .NET SDK 事件中心.NET SDK
  • Event Hubs Java SDK 事件中心Java SDK

E:\\Azure ML\\LAB04\\fitness_device\\node_modules\\azure-event-hubs\\lib\\client.js:92 throw new ArgumentError('Connection string doesn\\'t have EntityPath, or missing argument path'); E:\\ Azure ML \\ LAB04 \\ fitness_device \\ node_modules \\ azure-event-hubs \\ lib \\ client.js:92抛出新的ArgumentError('连接字符串没有EntityPath或缺少参数路径');

The connection string will have the following format: 连接字符串将具有以下格式:

Endpoint=sb://[your event hub namespace].servicebus.windows.net/;SharedAccessKeyName=[your policy name];SharedAccessKey=[key];EntityPath=[your event hub entity name]

You can add an entity like this: 您可以这样添加一个实体:

在此处输入图片说明

And then use this entity's connection string. 然后使用该实体的连接字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM