简体   繁体   English

在Azure Node.js App服务中使用LevelDB时出错

[英]Error in using LevelDB in Azure node.js App service

I'm trying to create a Node.js app with LevelDB module in Microsoft Azure app service. 我正在尝试在Microsoft Azure应用服务中使用LevelDB 模块创建Node.js应用。 I followed the steps given in this link to create an app. 我按照此链接中给出的步骤创建了一个应用程序。 I ran that locally (Windows10 64bit) and pushed it to the Azure. 我在本地(Windows10 64位)上运行该程序,并将其推送到Azure。 When I open the site in browser, it returns HTTP 500 error. 当我在浏览器中打开网站时,它返回HTTP 500错误。

When I run npm start in the terminal on https://{app-name}.scm.azurewebsites.net/DebugConsole , it returns the error at. 当我在终端https://{app-name}.scm.azurewebsites.net/DebugConsole上运行npm start时,它将返回错误。

    at D:\home\site\wwwroot\node_modules\levelup\lib\levelup.js:119:34
    at D:\home\site\wwwroot\node_modules\abstract-leveldown\abstract-leveldown.js:39:16
Express server listening on port 3000    

npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.4.7\\node.exe" "D:\\Program Files (x86)\\npm\\2.15.8\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! appName@0.0.1 start: `node app.js`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the appName@0.0.1 start script 'node app.js'.
npm ERR! This is most likely a problem with the appName package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs appName
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls appName
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\home\site\wwwroot\npm-debug.log

I checked the code in levelup.js:119:34 and added the log for that error. 我检查了levelup.js:119:34的代码,并添加了该错误的日志。 That log returns The filename, directory name, or volume label syntax is incorrect. 该日志返回The filename, directory name, or volume label syntax is incorrect.

I'm using LevelDB for storing the data. 我正在使用LevelDB来存储数据。 I initialised the db by var db = levelup('./mydb', { valueEncoding: 'json'}); 我通过var db = levelup('./mydb', { valueEncoding: 'json'});初始化db var db = levelup('./mydb', { valueEncoding: 'json'});

What should I do to use the levelDB in Microsoft Azure? 我应该怎么做才能在Microsoft Azure中使用levelDB? Any help would be appreciated. 任何帮助,将不胜感激。 Thanks. 谢谢。

According the requirement description at https://github.com/level/levelup#tested--supported-platforms , the module requires node-gyp via installation. 根据https://github.com/level/levelup#tested--supported-platforms上的需求描述,该模块需要通过安装进行node-gyp And Azure App Service does not support all native modules and might fail at compiling those with very specific prerequisites. 而且,Azure App Service不支持所有本机模块,并且可能无法编译具有非常特定的先决条件的模块。

Please double check whether modules have been install successfully on Azure Web Apps via Kudu console site, and you can install these modules on your local Windows machine in 32 bit, and deploy the entire application including node_modules folder to Azure Web Apps. 请仔细检查是否已通过Kudu控制台站点在Azure Web Apps上成功安装了模块,并且您可以32位在本地Windows计算机上安装这些模块,并将包括node_modules文件夹在内的整个应用程序部署到Azure Web Apps。

You can refer to https://azure.microsoft.com/en-us/documentation/articles/nodejs-use-node-modules-azure-apps/ for details. 您可以参考https://azure.microsoft.com/en-us/documentation/articles/nodejs-use-node-modules-azure-apps/了解更多信息。

Any further concern, please feel free to let me know. 如有任何其他疑问,请随时告诉我。

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

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