I have rudimentary experience in both Angular 2 and NodeJS development. I apologize if this question is too simple of nature.
My goal is to create a web interface which connects to a SQL Server database. This app would enable the user to easily send queries to and receive results from the connected database from the app.
Searching for solutions, I decided to import mssql module into my mssql-connection.service.ts after installing via npm. I was planning to use it in the service either by using dependency injection or its regular syntax. However, I am experiencing error while compiling in each of those situations.
First, in trying to use the DI method by writing import { MSSQL } from 'mssql'; I get two duplicate error messages node_modules/@types/mssql/index"' has no exported member 'MSSQL'.
Second, in my attempt to remedy the situation as a response, I write import 'mssql';. Then I get a total of three error messages: I get two duplicate error messages Can't resolve 'dns' in '...\node_modules\tedious\lib' and an error message Can't resolve 'dgram' in '...\node_modules\tedious\lib' I have also tried using const sql = require('mssql'); but this would give me Cannot find name 'require'. error message, preceded by the previous error messages.
I am stumped and would like to know why this is happening! I would like to be able to use external modules freely. I have also tried npm install @types/mssql but to no avail. My node version is v6.9.5, and am using Angular 4.0.0. Please help!
Thank you in advance.