我尝试使用的具体软件包是azure-sb
。
我不确定Aurelia要求我使用此软件包的特殊步骤。在一个新的Node.js Web应用程序中,我可以使用以下步骤,我可以正常使用该包:
npm install azure-sb --save
添加
"dependencies": {
"azure-sb": "0.10.4"
}
到package.json
server.js
我可以使用var azure = require('azure-sb');
并使用该软件包提供的所有功能。 当我在Aurelia尝试类似的东西时,我无法使用该包。
作为附加步骤,我将azure-sb
添加到aurelia.json
。
C:\Projects\AureliaNotification>au import azure-sb
INFO [Importer] ---------------------------------------------------------
INFO [Importer] *********** Configuring azure-sb ***********
INFO [Importer] [OK] Going to execute the "Amodrotrace Strategy" strategy
INFO [Importer] *********** Finished configuring azure-sb ***********
INFO [Metadata] Adding/removing dependencies to the 'vendor-bundle.js' bundle
INFO [Metadata] The 'azure-sb' dependency has been added.
INFO [Tutorial] *********** Tutorial ***********
INFO [Tutorial] Are you the maintainer of azure-sb and would you like to define
a tutorial that is displayed here?
INFO [Tutorial] In order to do so you can add an "aurelia"."import"."tutorial" s
ection to the package.json of azure-sb. This can be set to an array of strings.
INFO [Tutorial] *********** Importing the module ***********
INFO [Tutorial] The following import statements are possible:
INFO [Tutorial] import 'azure-sb';
INFO [Tutorial] import azure-sb from 'azure-sb';
INFO [Tutorial] import * as azure-sb from 'azure-sb';
INFO [Tutorial] We are looking into ways to detect what is the right one
INFO [Tutorial] *********** End of tutorial ***********
INFO [Importer] ---------------------------------------------------------
问题在于它在错误的位置查找所有azure-sb的依赖项。:
Tracing azure-sb...
------- File not found or not accessible ------
| Location: C:/Projects/AureliaNotification/src/util.js
| Requested by: C:\Projects\AureliaNotification\node_modules\azure-sb\lib\servic
ebus.js
| Is this a package? Make sure that it is configured in aurelia.json and that it
is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: C:/Projects/AureliaNotification/src/underscore.js
| Requested by: C:\Projects\AureliaNotification\node_modules\azure-sb\lib\servic
ebus.js
| Is this a package? Make sure that it is configured in aurelia.json and that it
is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: C:/Projects/AureliaNotification/src/url.js
| Requested by: C:\Projects\AureliaNotification\node_modules\azure-sb\lib\servic
ebus.js
| Is this a package? Make sure that it is configured in aurelia.json and that it
is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: C:/Projects/AureliaNotification/src/azure-common.js
| Requested by: C:\Projects\AureliaNotification\node_modules\azure-sb\lib\servic
ebus.js
| Is this a package? Make sure that it is configured in aurelia.json and that it
is not a Node.js package
-----------------------------------------------
(+更多)
我开始通过手工向aurelia.json 添加一些依赖项,但后来我需要添加这些依赖项的依赖项等,其中一些似乎并不存在。
是否可以选择告诉Aurelia如何解析azure-sb包中的requires
调用相对于正在执行此操作的javascript文件的位置?
答案 0 :(得分:0)
这是一个NodeJS软件包,所以它不能与在浏览器中运行的Aurelia一起使用。