I did create-react-app and also installed sequelize and pg. But when I do npm start, I get the following error -
./node_modules/pg/lib/connection-parameters.js
Module not found: Can't resolve 'dns' in '/Users/vedant/Web Dev/device_psql/node_modules/pg/lib'
Here is the App.js file -
import React, { Component } from 'react';
const Sequelize = require('sequelize');
const sequelize = new Sequelize('postgres', 'postgres', 'password', {
host: 'localhost',
dialect: 'postgres',
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000
},
// http://docs.sequelizejs.com/manual/tutorial/querying.html#operators
operatorsAliases: false
});
class App extends Component {
render() {
return (
<div >
<p>Test</p>
</div>
);
}
}
export default App;
Also, in the package.json file, I have sequelize and pg. What could be the problem? I have tried to delete the node_modules folder and doing npm install, but no luck.
Thanks in advance.