After a node application was deployed to Azure App Service Web Apps (Websites), the application threw an error at starting.
Node looked for:
While NPM installed it at:
The path template can be found in sqlite3\package.js
The issue could happen when the node that deploys the SQLite3 module, is a different version from the version of node that runs the application.
When "NPM install" was run to deploy the node application to worker instances, node was loaded from D:\Program Files (x86)\nodejs\0.10.32\
This node's version was 0.10.32, whose node_adi value was "node-v11". That's why the sqlite3 module was installed to node-v11-win32-ia32
This default version is controlled by an app setting available on the management portal. It is 0.10.32 at the moment.
The %PATH% environment is rendered according to this setting.
The node version used to launch the application can be controlled by application's package.json file
It's a best practice to sync up the version in package.json with the one on the management portal.
Azure doesn't update the default version immediately after making the latest node version available on worker instances. One reason is to not break the existing node application that were deployed by history node versions.
As a workaround, we could hard code the path in Sqlite3's package.js file.
Juntao Zhu from APAC DSI Team