I was trying to update my npm and used "sudo npm install -g npm" because without the "sudo" it wouldn't work on my mac. Now because of that mistake, opening up a development server takes an entire minute even on the simplest React projects!
I tried deleting my Node_Modules folder, doing "sudo npm uninstall -g npm", installed a new stable version of node.js, and even deleting the package-lock.json. And none of that worked.
packages.json :
{
"name": "periodic-project",
"version": "0.1.0",
"dependencies": {
"node-sass": "^4.14.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}