1

I am currently attempting to get an Sqlite database in a node app hosted on Azure Websites.

I've listed Sqlite3 in my dependencies field of package.json:

"sqlite3": "^3.0.8"

When I deploy, I see the following during install:

remote: [sqlite3] Success: "D:\home\site\wwwroot\node_modules\sqlite3\lib\binding\node-v11-win32-ia32\node_sqlite3.node" is installed via remote

However, every request returns a 500 error, so I checked out the app log.

When I look at the application log, I see the following error each deploy:

Mon Jun 29 2015 17:13:51 GMT+0000 (Coordinated Universal Time): Unaught exception: Error: Cannot find module 'D:\home\site\wwwroot\node_modules\sqlite3\lib\binding\node-v14-win32-ia32\node_sqlite3.node

If you notice, when running the application it looks for node_modules\sqlite3\lib\binding\node-v14-win32-ia32\node_sqlite3.node but it installed to node_modules\sqlite3\lib\binding\node-v11-win32-ia32\node_sqlite3.node. I don't understand enough about servers in general, or even node's environment to figure out how to get it pointed to the right location or the other version installed. It appears as though Azure has one machine building the code and another machine running the code, where they have different specs.

2
  • How do you deploy? Integrated Git repo, GitHub, FTP,...?
    – yannisgu
    Jul 3, 2015 at 20:35
  • I'm deploying via git; I push my changes to the Azure App Service repository and Azure deploys it. Jul 3, 2015 at 21:26

1 Answer 1

0

Try to set the Node JS version to 0.12.0. This can be done from the Azure portal with the following steps:

  1. Select the website
  2. Select "Settings" and then "Application Settings"
  3. Then under "App settings" change the value of "WEBSITE_NODE_DEFAULT_VERSION" to "0.12.0"
4
  • This sounds like it should have worked, but the folders have not changed. Great idea though! Was certain it would work! Jul 3, 2015 at 21:59
  • Not sure if I understand you correctly. Does this solved your issue?
    – yannisgu
    Jul 4, 2015 at 8:50
  • I used the remote console to manually uninstall and reinstall sqlite3 and it now has the correct path, but I'd guess the issue will still occur on deploy. Jul 4, 2015 at 12:36
  • Ah, so it looks like npm-install may not change every deploy unless package.json changed! This works now on each deploy! Jul 4, 2015 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.