2016-09-30 60 views
0

我試圖在Microsoft Azure應用服務中使用LevelDB module創建一個Node.js應用。我遵循這個link給出的步驟來創建一個應用程序。我在本地運行(Windows10 64位)並將其推送到Azure。當我在瀏覽器中打開該網站時,它會返回HTTP 500錯誤。在Azure中使用LevelDB的錯誤node.js應用服務

當我在https://{app-name}.scm.azurewebsites.net/DebugConsole的終端上運行npm start時,它返回錯誤at。

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! [email protected] start: `node app.js` 
npm ERR! Exit status 7 
npm ERR! 
npm ERR! Failed at the [email protected] 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 

我檢查了代碼levelup.js:119:34並添加了日誌中的錯誤。該日誌返回The filename, directory name, or volume label syntax is incorrect.

我正在使用LevelDB存儲數據。我初始化分貝由var db = levelup('./mydb', { valueEncoding: 'json'});

我該怎麼做才能使用Microsoft Azure中的levelDB?任何幫助,將不勝感激。謝謝。

+0

如果您可以分享一些代碼,這將會很有幫助。 – Srijan

回答

0

根據https://github.com/level/levelup#tested--supported-platforms的要求說明,該模塊需要通過安裝node-gyp。 Azure App Service不支持所有本機模塊,並且可能無法編譯具有特定先決條件的模塊。

請仔細檢查模塊是否已通過Kudu控制檯站點成功安裝在Azure Web應用程序上,並且可以在本地Windows計算機上以32位方式安裝這些模塊,並將包括node_modules文件夾在內的整個應用程序部署到Azure Web Apps。

有關詳細信息,請參閱https://azure.microsoft.com/en-us/documentation/articles/nodejs-use-node-modules-azure-apps/

任何進一步的關注,請隨時讓我知道。

相關問題