john
john

Reputation: 23

NodeJS Azure Sequelize SQL Server - Error: Please install tedious package manually

So I've been developing a NodeJs app locally on my Windows machine. I opened a simple SQL Server instance in the Azure cloud.

While testing this way (node on localhost, SQL Server in Azure cloud) all works fine - everything works.

Once the nodejs rest api is deployed to Azure (excuse my french) all hell broke loose:

Error: Please install tedious package manually
    at ConnectionManager._loadDialectModule (D:\home\site\wwwroot\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:81:15)
    at new ConnectionManager (D:\home\site\wwwroot\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:17:21)
    at new MssqlDialect (D:\home\site\wwwroot\node_modules\sequelize\lib\dialects\mssql\index.js:14:30)
    at new Sequelize (D:\home\site\wwwroot\node_modules\sequelize\lib\sequelize.js:324:20)
    at Object.<anonymous> (D:\home\site\wwwroot\util\database.js:3:19)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (D:\home\site\wwwroot\server.js:6:19)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (D:\Program Files (x86)\iisnode\interceptor.js:459:1)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
Application has thrown an uncaught exception and is terminated:
Error: Please install tedious package manually
    at ConnectionManager._loadDialectModule (D:\home\site\wwwroot\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:81:15)
    at new ConnectionManager (D:\home\site\wwwroot\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:17:21)
    at new MssqlDialect (D:\home\site\wwwroot\node_modules\sequelize\lib\dialects\mssql\index.js:14:30)
    at new Sequelize (D:\home\site\wwwroot\node_modules\sequelize\lib\sequelize.js:324:20)
    at Object.<anonymous> (D:\home\site\wwwroot\util\database.js:3:19)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (D:\home\site\wwwroot\server.js:6:19)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (D:\Program Files (x86)\iisnode\interceptor.js:459:1)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)

here's a snapshot of my package.json file :

"devDependencies": {
    "dotenv": "^8.2.0",
    "nodemon": "^2.0.3"
  },
  "dependencies": {
    "axios": "^0.19.2",
    "azure-storage": "^2.10.3",
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.19.0",
    "express": "^4.17.1",
    "formdata-node": "^2.1.1",
    "into-stream": "^5.1.1",
    "jsonwebtoken": "^8.5.1",
    "mssql": "^6.1.0",
    "multer": "^1.4.2",
    "nodemailer": "^6.4.5",
    "sequelize": "^5.21.7",
    "tedious": "^8.0.1",
    "uuid-token-generator": "^1.0.0"
  }

The error being thrown/shown on the error page I get back from Azure:

HTTP Error 500.1002 - Internal Server Error

I'm not sure what I'm doing wrong. I'd love some help.

Upvotes: 2

Views: 877

Answers (1)

Jason Pan
Jason Pan

Reputation: 21873

When deploying web apps, application environment factors are important. Azure as the hosting service of the program, there are definitely some environments that are different from local.

So I suggest to visit the website https://your-app.scm.azurewebsites.net/DebugConsole to enter kudu and enter the site->wwwroot folder To delete the node_modules folder on the server. Compress node_modules in the local project into zip format, and then drag and drop directly into kudu. Then proceed to the next test.

enter image description here

You also can run npm install tedious in command line, but I failed and don't know why. But I still think this is a good way to solve it. For more details, you can visit the url.Azure web app tedious

Upvotes: 1

Related Questions