gpt4 book ai didi

node.js - NodeJS Azure Sequelize SQL Server - 错误 : Please install tedious package manually

转载 作者:行者123 更新时间:2023-12-03 22:17:06 35 4
gpt4 key购买 nike

所以我一直在我的 Windows 机器上本地开发 NodeJs 应用程序。我在 Azure 云中打开了一个简单的 SQL Server 实例。

以这种方式进行测试(本地主机上的 Node 、Azure 云中的 SQL Server)一切正常 - 一切正常。

一旦将nodejs Rest api部署到Azure(请原谅我的法语),一切就都崩溃了:

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)

这是我的 package.json 文件的快照:

"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"
}

我从 Azure 返回的错误页面上抛出/显示的错误:

HTTP Error 500.1002 - Internal Server Error

我不确定我做错了什么。我希望得到一些帮助。

最佳答案

部署 Web 应用程序时,应用程序环境因素很重要。 Azure作为程序的托管服务,肯定存在一些与本地不同的环境。

所以我建议访问网站https://your-app.scm.azurewebsites.net/DebugConsole输入kudu并输入site->wwwroot 文件夹 删除服务器上的node_modules 文件夹。将本地项目中的node_modules压缩为zip格式,然后直接拖放到kudu中。然后进行下一个测试。

enter image description here

您也可以在命令行中运行npm install tedious,但我失败了并且不知道为什么。但我仍然认为这是解决问题的好方法。欲了解更多详情,您可以访问网址。 Azure web app tedious

关于node.js - NodeJS Azure Sequelize SQL Server - 错误 : Please install tedious package manually,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61982607/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com