0

I am a beginner learning react js. I have implemented a REST API (https://jsonplaceholder.typicode.com/)

I have used "concurrently" to simultaneously run two scripts using "npm run start:dev", but i am getting a error while executing this.

the given below is my package.json file

     {
      "name": "myproj",
      
      "version": "0.1.0",
    
      "private": true,
    
      "dependencies": 
    
    {
        "@testing-library/jest-dom": "^5.11.4",
    
        "@testing-library/react": "^11.1.0",
        "@testing-library/user-event": "^12.1.10",
        "axios": "^0.21.1",
        "bootstrap": "^4.6.0",
        "json-server": "^0.16.3",
        "react": "^17.0.1",
        "react-dom": "^17.0.1",
        "react-router-dom": "^5.2.0",
        "react-scripts": "4.0.2",
        "web-vitals": "^1.0.1"
      }
    
      "scripts": 
    {
        "start": "react-scripts start",
    
        "json-server": "json-server --watch db.json --port 3001",
    
        "start:dev": "concurrently \"npm start\" \"npm run json-server\"",
    
        "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"
        ]
      }
    }

the error i am getting

D:\FirstReact\myproj>npm start 

> myproj@0.1.0 start D:\FirstReact\myproj
 
>concurrently "npm start" "npm run json-server"  

code ELIFECYCLE
npm ERR! errno 1                                                                             
npm ERR! myproj@0.1.0 start: `react-scripts start:`concurrently "npm run json- server"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myproj@0.1.0 start script.
npm ERR! This is probably not a problem with npm.There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sony\AppData\Roaming\npm-cache\_logs\2021-02-24T13_50_08_231Z-debug.log

Please tell me how to resolve this error

Here is an image of the error error image

Here is an image of my project structure my project structure

Mike
  • 23,542
  • 14
  • 76
  • 87

0 Answers0