0

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"
    ]
  }
}
Kevin Tran
  • 21
  • 2
  • As you have used -g, you need to delete the global node modules. Try checking out this https://stackoverflow.com/questions/25045946/where-should-my-npm-modules-be-installed-on-mac-os-x – Han Jan 13 '21 at 06:20
  • @han I just tried it is still the same as before. Thank you for the reply! – Kevin Tran Jan 13 '21 at 06:37
  • @han I'm an idiot, I figure it out. I had to uninstall everything related to node and npm and then it worked. Thank you so much! – Kevin Tran Jan 13 '21 at 07:19

0 Answers0