skip to Main Content

I have a ReactJS project, with package.json file:

{
  "name": "front-end",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "bootstrap": "^5.3.2",
    "cors": "^2.8.5",
    "pg-promise": "^11.5.4",
    "querystring": "^0.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-resizable": "^3.0.5",
    "react-router-dom": "^6.16.0",
    "react-scripts": "5.0.1",
    "react-split-pane": "^0.1.92",
    "web-vitals": "^2.1.4",
    "zlib": "^1.0.5"
  },
  "devDependencies": {
    "nodemon": "^2.0.22"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "dev": "nodemon server.js"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Whenever I do npm install it does not work therefore I add –force flag and I get:

npm error path C:UsersMASTERDatabaseViewerAppfront-endnode_moduleszlib
npm error command failed
npm error command C:Windowssystem32cmd.exe /d /s /c node-waf clean || true; node-waf configure build
npm error System cannot find the path specified
npm error 'true' is not recognized as an internal or external command,
npm error operable program or batch file.
npm error A complete log of this run can be found in: C:UsersMASTERAppDataLocalnpm-cache_logs2024-09-26T18_02_42_496Z-debug-0.log

When I do npn run dev I can see that some libraries cannot be resolved:
Module not found: Error: Can’t resolve ‘react-router-dom’ in ‘C:UsersMASTERDatabaseViewerAppfront-endsrc’

Even when I try to install this module with –force it still occurs.

2

Answers


  1. Chosen as BEST ANSWER

    Basically removing of line:

    "zlib": "^1.0.5"

    From "dependecies" in package.json solved a problem


  2. You’re going to have to break this down to figure out what’s not working. There are a lot of things I can suggest, but the question is awfully broad the way it’s phrased and there could be several things wrong.

    Have you tried rm -rf node_modules package-lock.json and then npm install again?

    If that doesn’t work my next two questions are:

    1. Did you write this code or did you download/generate it from somewhere else?

    2. Has it ever worked or did it just suddenly stop working?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search