node.js - Azure移动服务错误找不到模块 'azure-storage'

标签 node.js azure azure-mobile-services azure-table-storage

我一直在使用Azure-storage过去几个月,我的 AzureMobileService 自定义 API 中的 npm 模块一直工作正常,直到几天前它开始给我这个错误 - 找不到模块“azure-storage”。这很奇怪,因为我没有稍微更改我的代码,实际上在它开始给我这个错误的那天,我早上检查了我的应用程序(HTML/JS 应用程序),一切都运行良好。但是当我下类回来并运行该应用程序时,我收到了此错误。下面是我的自定义 api 中的代码,我在其中收到此错误

var azure = require('azure-storage');
var retryOperationFilter = new azure.ExponentialRetryPolicyFilter();
var tableService= azure.createTableService().withFilter(retryOperationFilter);

我的 package.json 中确实包含了 azure-storage -

"dependencies": {"tracer": "0.7.3", "colors" : "1.0.3", "lodash" :"2.4.1", "azure-storage": "0.4.1"},

我问了这个question在“Azure-storage”npm 页面,但没有得到太多帮助,所以现在在这里尝试;现在已经两天了,我还没有解决这个问题,这很烦人,我束手无策。 任何有过相同经历或可能有任何想法的人,如果您能分享您对此的任何了解,我将不胜感激。

最佳答案

最终通过手动 npm install 'azure-storage' 到我的移动服务使其正常工作。

我从未想过尝试手动 npm 安装,因为我的 package.json 中的其他 Node 模块(如跟踪器、lodash)无需手动 npm 安装即可正常工作。另外,正如我记得读过的那样,如果我只在移动服务的 package.json 中包含我想要使用的 npm 模块并推送它,服务器上的移动服务就会安装它并重新启动,而我不需要自己手动安装。这就是我的代码上周运行时所发生的情况。

关于node.js - Azure移动服务错误找不到模块 'azure-storage',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27853171/

相关文章:

c# - Azure 移动服务 TableController 不返回内部对象

android - NPM 缓存步骤在 Azure DevOps 中不起作用

node.js - NPM 7.0.0 的工作空间是否需要 Lerna?

javascript - Azure 移动服务防止重复条目

c# - 解码 Azure 移动服务 JWT token 时出现 JwtSecurityToken 异常

azure - 如何从 Microsoft Azure 转出域名?

node.js - pm2 显示 1.2GB 而 heapdump 显示 80MB

javascript - NodeJS 未加载外部 javascript

c# - Xamarin Forms OAuth 2.0 和 Azure Active Directory - 错误 AdalServiceException : AADSTS7000218

python - Microsoft BotFramework Python 机器人部署