0

I've been stuck for a couple of days trying to get a docker container to run for npm on my laravel install. No matter what I try npm install always ends in the error below or something similar.

npm ERR! code EINTEGRITY
npm ERR! sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== integrity checksum failed when using sha512: wanted sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== but got sha512-XfyffAC+g/7ZA4f5L0XtDj2yuUZIpXolG23LrI8FAM9661vPwCRW50r9xTi16O7+IhE+OGMFJrOLnBvSbByphQ==. 

I have tried npm cache verify, npm cache clear --force, removing package-lock.json, and reinstalling npm within the container.

My dockerfile is

FROM node:latest
WORKDIR /var/www
COPY package*.json ./
RUN npm cache verify
RUN node -v (node -v returns 14.2.0)
RUN npm -v (npm -v returns 6.14.4)
RUN npm install
COPY . .

EXPOSE 3000
CMD [ "npm", "start" ]

and in my docker-compose

  npm:
      image: node:latest
      container_name: npm
      working_dir: /var/www
      build:
        context: ./
        dockerfile: node.dockerfile

My package.json is the default from the laravel install (below)

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.19",
        "bootstrap": "^4.0.0",
        "cross-env": "^7.0",
        "jquery": "^3.2",
        "laravel-mix": "^5.0.1",
        "lodash": "^4.17.13",
        "popper.js": "^1.12",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.20.1",
        "sass-loader": "^8.0.0",
        "vue": "^2.5.17",
        "vue-template-compiler": "^2.6.10"
    }
}

Any help at this point would be very much appreciated. Thank you.

awebs
  • 11
  • 1
  • 6
  • 1
    Does this answer your question? [When I run \`npm install\`, it returns with \`ERR! code EINTEGRITY\` (npm 5.3.0)](https://stackoverflow.com/questions/47545940/when-i-run-npm-install-it-returns-with-err-code-eintegrity-npm-5-3-0) – Adiii May 09 '20 at 11:14
  • @Adiii, thanks but no, I have been through those answers. – awebs May 09 '20 at 11:18
  • then post pacakge.json so we can reproduce the issue – Adiii May 09 '20 at 11:33
  • @Adiii edited with package.json – awebs May 09 '20 at 11:43

0 Answers0