npm run dev does not start server, but does not throw any errors #99

  express, file-upload, javascript, node.js, reactjs

I’m trying to build a react file upload app. However, when running npm run dev to run the client and server concurrently, it seems to work fine in the terminal however, the actual development server doesn’t run.

package.json file located in app

{
  "name": "react-fileupload",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "scripts": {
    "start": "node server.js",
    "server": "nodemon server.js",
    "client": "npm start --prefix client",
    "dev": "concurrently "npm run server" "npm run client""
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "concurrently": "^6.2.0",
    "nodemon": "^2.0.12"
  },
  "dependencies": {
    "audit": "0.0.6",
    "express": "^4.17.1",
    "express-fileupload": "^1.2.1",
    "fix": "0.0.6",
    "npm": "^7.20.0"
  }
}

react package.json file located in src

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^0.21.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "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"
    ],
    "proxy": "http://localhost:5000/"
  }
}

Source: Ask Javascript Questions

LEAVE A COMMENT