简体   繁体   English

Azure API应用程序Node.js部署问题

[英]Azure API App Node.js deployment issues

I'm testing Azure API App service with a Node.js (Express, Swaggerize, Sequelize and SQLlite). 我正在使用Node.js(Express,Swaggerize,Sequelize和SQLlite)测试Azure API App服务。 So far, everything is working in my development workstation, but I bumping into some issues when trying to deploy the app. 到目前为止,一切都可以在开发工作站中正常工作,但是在尝试部署应用程序时遇到了一些问题。

First, I created the API App "container" and I've connected my VSTS Git repo with the API container. 首先,我创建了API应用程序“容器”,并将VSTS Git存储库与API容器相连。 Everything works well when pushing code to the repo (automatically the container gets all the changes in few seconds). 将代码推送到仓库时,一切工作都很好(容器会在几秒钟内自动获得所有更改)。

But... (question(s) following) 但是...(以下问题)

  1. How can I resolve my Node dependencies? 如何解决我的Node依赖关系? (so far, I've been invoking "npm install" manually through container console. I don't want to push my packages in the GIT repo (到目前为止,我一直在通过容器控制台手动调用“ npm install”。我不想在GIT存储库中推送我的软件包
  2. I cannot use SQLite dialect in sequelize because although the package seems to be inside of my app dependencies and in the node_modules directory, my apps still throws an exception 我无法在续集中使用SQLite方言,因为尽管该软件包似乎在我的应用程序依赖关系之内以及在node_modules目录中,但我的应用程序仍会引发异常

     Wed Mar 02 2016 16:57:16 GMT+0000 (Coordinated Universal Time): Unaught exception: Error: Please install sqlite3 package manually at new ConnectionManager (D:\\home\\site\\wwwroot\\node_modules\\sequelize\\lib\\dialects\\sqlite\\connection-manager.js:24:11) at new SqliteDialect (D:\\home\\site\\wwwroot\\node_modules\\sequelize\\lib\\dialects\\sqlite\\index.js:12:28) at new Sequelize (D:\\home\\site\\wwwroot\\node_modules\\sequelize\\lib\\sequelize.js:213:18) at Object.<anonymous> (D:\\home\\site\\wwwroot\\app\\models\\index.js:8:17) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at Object.<anonymous> (D:\\home\\site\\wwwroot\\app\\app.js:11:14) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at Object.<anonymous> (D:\\home\\site\\wwwroot\\server.js:3:1) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) 

Is there something that I'm missing? 有什么我想念的吗?

It seems that the issue was caused by missing the npm package sqlite3 . 看来此问题是由于缺少npm软件包sqlite3引起的。 So you need to install the package manually, but the installation will be failed because the installation for package sqlite3 need gyp compiler (according to the description of the package here ) that not support on Azure App Service. 因此,您需要手动安装程序包,但安装将失败,因为程序包sqlite3的安装需要不支持Azure App Service的gyp编译器(根据此处的程序包说明)。

You can refer to the section Native Modules of the doc Using Node.js Modules with Azure applications to know the reason and how to work around. 您可以参考节Native Modules的文档的使用Node.js的模块与Azure应用程序知道原因以及如何解决。

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

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