title: How to write missing dev script in React?
body: <p>When I run docker-compose up on my project the backend runs fine but the frontend fails and keeps restarting. It cites &quot;npm ERR! missing script: dev&quot; as the error. Now I am using react and dev isnt one of the default scripts when creating an app so Im not sure how to write it.
  This is my package.json file.</p>
  <pre><code>{
  &quot;name&quot;: &quot;frontend&quot;,
  &quot;version&quot;: &quot;0.3.0&quot;,
  &quot;private&quot;: true,
  &quot;dependencies&quot;: {
  &quot;@testing-library/jest-dom&quot;: &quot;^5.11.9&quot;,
  &quot;@testing-library/react&quot;: &quot;^11.2.3&quot;,
  &quot;@testing-library/user-event&quot;: &quot;^12.6.0&quot;,
  &quot;bootstrap&quot;: &quot;^4.5.3&quot;,
  &quot;react&quot;: &quot;^17.0.1&quot;,
  &quot;react-bootstrap&quot;: &quot;^1.4.3&quot;,
  &quot;react-dom&quot;: &quot;^17.0.1&quot;,
  &quot;react-scripts&quot;: &quot;4.0.1&quot;,
  &quot;web-vitals&quot;: &quot;^0.2.4&quot;
  },
  &quot;scripts&quot;: {
  &quot;start&quot;: &quot;react-scripts start&quot;,
  &quot;build&quot;: &quot;react-scripts build&quot;,
  &quot;test&quot;: &quot;react-scripts test --passWithNoTests&quot;,
  &quot;eject&quot;: &quot;react-scripts eject&quot;
  },
  &quot;eslintConfig&quot;: {
  &quot;extends&quot;: [
    &quot;react-app&quot;,
    &quot;react-app/jest&quot;
  ]
  },
  &quot;browserslist&quot;: {
  &quot;production&quot;: [
    &quot;&gt;0.2%&quot;,
    &quot;not dead&quot;,
    &quot;not op_mini all&quot;
  ],
  &quot;development&quot;: [
    &quot;last 1 chrome version&quot;,
    &quot;last 1 firefox version&quot;,
    &quot;last 1 safari version&quot;
  ]
  }
  }
  </code></pre>
  <p>I figured I would write it just like all the others, so I wrote &quot; &quot;dev&quot;: &quot;react-scripts dev&quot; &quot; but it did not work.</p>
  <p>docker-compose.yml file below</p>
  <pre><code>version: '2.4'
  
  services:
    frontend:
      build:
        context: ./frontend
    ports:
      - &quot;8050:8000&quot;
    volumes:
      - .:/frontend
    environment:
      CI: 'true'
    restart: always
  backend:
    build:
      context: ./backend
    ports:
      - &quot;4050:5000&quot;
    volumes:
      - ./backend:/opt/app
    restart: always
  </code></pre>
  <p>frontend Dockerfile</p>
  <pre><code>FROM node:latest
  COPY . /opt/app
  WORKDIR /opt/app
  CMD [&quot;npm&quot;, &quot;run&quot;, &quot;start&quot;]
  </code></pre>