Answers: <p>You cannot rely on <code>FROM node:10.15-alpine</code> alone to fix this. I had to go with the fix from the facebook team. So if anyone else did not get a fix from modifying your <code>Dockerfile</code> to <code>node:10.15-alpine</code>, go to your <code>package.json</code> file and change react-scripts to the following facebook fix:</p>
  
  <p><code>"react-scripts": "3.0.0-next.b0cbf2ca"</code></p>
  
  <p>Then go ahead and remove your <code>node_modules/</code> folder via <code>rm -rf node_modules</code> and then run <code>npm install</code>, check your <code>jest-util</code> file, it should now have an output like this:</p>
  
  <pre><code>└─┬ react-scripts@3.0.0-next.b0cbf2ca
    ├─┬ babel-jest@24.5.0
    │ └─┬ @jest/transform@24.5.0
    │   ├─┬ jest-haste-map@24.5.0
    │   │ └── jest-util@24.5.0  deduped
    │   └── jest-util@24.5.0
    └─┬ jest@24.5.0
      └─┬ jest-cli@24.5.0
        ├─┬ @jest/core@24.5.0
        │ ├─┬ @jest/reporters@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-runner@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-runtime@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├── jest-util@24.5.0  deduped
        │ └─┬ jest-watcher@24.5.0
        │   └── jest-util@24.5.0  deduped
        ├─┬ jest-config@24.5.0
        │ ├─┬ jest-environment-jsdom@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-environment-node@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-jasmine2@24.5.0
        │ │ ├─┬ jest-each@24.5.0
        │ │ │ └── jest-util@24.5.0  deduped
        │ │ └── jest-util@24.5.0  deduped
        │ └── jest-util@24.5.0  deduped
        └── jest-util@24.5.0  deduped
  </code></pre>
  
  <p>You should be good to run TravisCI build now. The issue is the react-scripts version <code>2.1.8</code> is conflicting with new version of Node. Suffered through this all day long, grateful to the facebook team for getting back to me. </p>
  
  <p>For reference: <a href="https://github.com/facebook/create-react-app/issues/6475" rel="nofollow noreferrer">https://github.com/facebook/create-react-app/issues/6475</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-03-18T03:01:47.003Z
Answers: 2019-03-18T03:01:47.003Z
Answers: Daniel
Body: <p>So I ran my Docker build with TravisCI and I got a failure like so:</p>
  
  <pre><code>FAIL src/App.test.js
    ● Test suite failed to run
      TypeError: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object '#&lt;process&gt;'
        at exports.default (node_modules/jest-util/build/create_process_object.js:15:34)
  </code></pre>
  
  <p>I did not think that this <code>App.test.js</code> file would give me problems after I removed the logic from within the <code>it</code> block like so:</p>
  
  <pre><code>import React from "react";
  import ReactDOM from "react-dom";
  import App from "./App";
  
  it("renders without crashing", () =&gt; {});
  </code></pre>
  
  <p>I thought the issue may have been the latest release of <code>node</code> because I saw others have similar error messages, so I changed my version like so:</p>
  
  <p><code>FROM node:10.15-alpine as builder</code> OR <code>FROM node:10.15-alpine</code> as I have various <code>Dockerfile</code>s for each service I am building as this is a multi-container project.</p>
  
  <p>That change I made did not resolve the issue, TravisCI continues to fail my build with the same exact error, what gives here?</p>
  
  <p>I thought perhaps the issue would be a version of Jest mismatch, but I have not installed any version of Jest, this is my <code>package.json</code> file inside my <code>client/src/App.test.js</code>:</p>
  
  <pre><code>{
    "name": "client",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "react": "^16.8.3",
      "react-dom": "^16.8.3",
      "react-scripts": "2.1.5",
      "react-router-dom": "4.3.1",
      "axios": "0.18.0"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": "react-app"
    },
    "browserslist": [
      "&gt;0.2%",
      "not dead",
      "not ie &lt;= 11",
      "not op_mini all"
    ]
  }
  </code></pre>
  
  <p>None of the solutions above have helped me. You cannot upgrade Jest because react-scripts comes with version 23.x so you are just adding on top of what react-scripts would already have. You cannot upgrade react-scripts so that it will have jest@24 because the latest version has jest@23.</p>
  
  <p>Changing to v11.10.1 does not help either and within my Dockerfile I have tried changing the 'FROM' in my <code>Dockerfile</code> to <code>FROM node:10.15-alpine</code> and that has not helped.</p>
  
  <p>When I tested it in this manner:</p>
  
  <p><code>docker run -it --rm -v $(PWD):$(PWD) -w $(PWD) node:10.15-alpine npm test</code></p>
  
  <p>it passed!</p>
  
  <pre><code> PASS  src/App.test.js (10.163s)
  
    ✓ renders without crashing (5ms)
  </code></pre>
  
  <p>But it does not pass in TravisCI</p>
  
  <p>This is my <code>Dockerfile</code> for my <code>client/src</code> directory:</p>
  
  <pre><code>FROM node:10.15-alpine as builder
  WORKDIR '/app'
  COPY package*.json ./
  RUN npm install
  COPY . .
  RUN npm run build
  
  FROM nginx
  EXPOSE 3000
  COPY --from=builder /app/build /usr/share/nginx/html
  </code></pre>
  
  <p>I even tried changing my <code>.travis.yml</code> file to this:</p>
  
  <p><code>- docker run -it --rm -v myproject/react-test node:10.15-alpine npm test -- --coverage</code>,</p>
  
  <p>when it was originally this:</p>
  
  <pre><code>script:
    - docker run myproject/react-test npm test -- --coverage
  </code></pre>
  
  <p>Absolutely nothing appears to be working here.</p>
  
Tags: <docker><dockerfile><travis-ci><node.js><alpine>
Title: TravisCI build continues to fail even after changing alpine version
UserDisplayName: Daniel
ThreadText: # TravisCI build continues to fail even after changing alpine version
  
  (Asked by: username_0 on 2019-03-17)
  
  So I ran my Docker build with TravisCI and I got a failure like so:
  
  ```
  FAIL src/App.test.js
    ● Test suite failed to run
      TypeError: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object '#<process>'
        at exports.default (node_modules/jest-util/build/create_process_object.js:15:34)
  
  ```
  
  I did not think that this `App.test.js` file would give me problems after I removed the logic from within the `it` block like so:
  
  ```
  import React from "react";
  import ReactDOM from "react-dom";
  import App from "./App";
  
  it("renders without crashing", () => {});
  
  ```
  
  I thought the issue may have been the latest release of `node` because I saw others have similar error messages, so I changed my version like so:
  
  `FROM node:10.15-alpine as builder` OR `FROM node:10.15-alpine` as I have various `Dockerfile`s for each service I am building as this is a multi-container project.
  
  That change I made did not resolve the issue, TravisCI continues to fail my build with the same exact error, what gives here?
  
  I thought perhaps the issue would be a version of Jest mismatch, but I have not installed any version of Jest, this is my `package.json` file inside my `client/src/App.test.js`:
  
  ```
  {
    "name": "client",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "react": "^16.8.3",
      "react-dom": "^16.8.3",
      "react-scripts": "2.1.5",
      "react-router-dom": "4.3.1",
      "axios": "0.18.0"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": "react-app"
    },
    "browserslist": [
      ">0.2%",
      "not dead",
      "not ie <= 11",
      "not op_mini all"
    ]
  }
  
  ```
  
  None of the solutions above have helped me. You cannot upgrade Jest because react-scripts comes with version 23.x so you are just adding on top of what react-scripts would already have. You cannot upgrade react-scripts so that it will have jest@24 because the latest version has jest@23.
  
  Changing to v11.10.1 does not help either and within my Dockerfile I have tried changing the 'FROM' in my `Dockerfile` to `FROM node:10.15-alpine` and that has not helped.
  
  When I tested it in this manner:
  
  `docker run -it --rm -v $(PWD):$(PWD) -w $(PWD) node:10.15-alpine npm test`
  
  it passed!
  
  ```
   PASS  src/App.test.js (10.163s)
  
    ✓ renders without crashing (5ms)
  
  ```
  
  But it does not pass in TravisCI
  
  This is my `Dockerfile` for my `client/src` directory:
  
  ```
  FROM node:10.15-alpine as builder
  WORKDIR '/app'
  COPY package*.json ./
  RUN npm install
  COPY . .
  RUN npm run build
  
  FROM nginx
  EXPOSE 3000
  COPY --from=builder /app/build /usr/share/nginx/html
  
  ```
  
  I even tried changing my `.travis.yml` file to this:
  
  `- docker run -it --rm -v myproject/react-test node:10.15-alpine npm test -- --coverage`,
  
  when it was originally this:
  
  ```
  script:
    - docker run myproject/react-test npm test -- --coverage
  
  ```
  
  Absolutely nothing appears to be working here.
  
  **Tags:** docker, dockerfile, travis-ci, node.js, alpine
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-03-18. Score: 0 | Accepted answer
  
  You cannot rely on `FROM node:10.15-alpine` alone to fix this. I had to go with the fix from the facebook team. So if anyone else did not get a fix from modifying your `Dockerfile` to `node:10.15-alpine`, go to your `package.json` file and change react-scripts to the following facebook fix:
  
  `"react-scripts": "3.0.0-next.b0cbf2ca"`
  
  Then go ahead and remove your `node_modules/` folder via `rm -rf node_modules` and then run `npm install`, check your `jest-util` file, it should now have an output like this:
  
  ```
  └─┬ react-scripts@3.0.0-next.b0cbf2ca
    ├─┬ babel-jest@24.5.0
    │ └─┬ @jest/transform@24.5.0
    │   ├─┬ jest-haste-map@24.5.0
    │   │ └── jest-util@24.5.0  deduped
    │   └── jest-util@24.5.0
    └─┬ jest@24.5.0
      └─┬ jest-cli@24.5.0
        ├─┬ @jest/core@24.5.0
        │ ├─┬ @jest/reporters@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-runner@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-runtime@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├── jest-util@24.5.0  deduped
        │ └─┬ jest-watcher@24.5.0
        │   └── jest-util@24.5.0  deduped
        ├─┬ jest-config@24.5.0
        │ ├─┬ jest-environment-jsdom@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-environment-node@24.5.0
        │ │ └── jest-util@24.5.0  deduped
        │ ├─┬ jest-jasmine2@24.5.0
        │ │ ├─┬ jest-each@24.5.0
        │ │ │ └── jest-util@24.5.0  deduped
        │ │ └── jest-util@24.5.0  deduped
        │ └── jest-util@24.5.0  deduped
        └── jest-util@24.5.0  deduped
  
  ```
  
  You should be good to run TravisCI build now. The issue is the react-scripts version `2.1.8` is conflicting with new version of Node. Suffered through this all day long, grateful to the facebook team for getting back to me.
  
  For reference: <https://github.com/facebook/create-react-app/issues/6475>
  
  
  ---
  
  