Reputation: 11
So I made an API to access a SQL Server using Express and mssql. The API works fine on my local machine, but when I go to run it on our production web server, I get an error. Here is the full error thrown when I run 'node server.js': here
Some more info: Currently, the API is running fine on production but it is running mssql version 5. I have to update to mssql v6 for a feature I need, and after I update this error begins to happen. What is happening is mssql v5 does not have a dependency for @azure/ms-rest-nodeauth, but v6 does. So v5 runs fine because it doesnt need ms-rest-nodeauth but v6 can't run because it needs it and it can't find it. I am unsure why this package cannot be found. I can see ms-rest-nodeauth installed in node_modules/@azure/ms-rest-nodeauth/, so the package is being found by npm and installed. Furthermore I don't have this issue on my computer running windows 10. I am really stumped by this.
I am using node v12.18.4, windows server 2016.
Upvotes: 0
Views: 444
Reputation: 11
I found a solution by changing the driver that mssql is using from Tedious to msnodesqlv8. By not using Tedious, I was able to skip the dependency on ms-rest-nodeauth completely. Obviously this is just sort of a workaround, and if you needed to use Tedious for whatever reason this solution will not work for you. If you have any idea on how I could fix this for real without having to just change what packages I am using I would still appreciate some input.
Upvotes: 1