nodejs / docker-node

Official Docker Image for Node.js :whale: :turtle: :rocket:
https://hub.docker.com/_/node/
MIT License
8.28k stars 1.97k forks source link

NPM install command failing when building Docker image #1841

Closed lempuris closed 1 year ago

lempuris commented 1 year ago

I'm trying to build an image of my angular application but the npm install step keeps falling with executor failed running [/bin/sh -c npm install --production --silent && mv node_modules ../]: exit code: 1

There are two applications. The one I'm building the image for is found under projects/transactional

Here is my Dockerfile

FROM node:10-alpine ENV NODE_ENV=production WORKDIR /usr/projects/transactional COPY ["package.json", "npm-shrinkwrap.json", "./"] RUN npm install --production --silent && mv node_modules ../ COPY . ./projects/transactional EXPOSE 4200 RUN chown -R node /usr/projects/transactional USER node CMD ["npm", "start"]

my package.json file

{ "name": "p-tool", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", }, "private": true, "dependencies": { "@angular/animations": "11.2.14", "@angular/common": "11.2.14", "@angular/compiler": "11.2.14", "@angular/core": "11.2.14", "@angular/forms": "11.2.14", "@angular/platform-browser": "11.2.14", "@angular/platform-browser-dynamic": "11.2.14", "@angular/router": "11.2.14", "@handsontable/angular": "^8.4.0", "@swimlane/ngx-datatable": "^19.0.0", "angular2-text-mask": "~9.0.0", "bootstrap": "^4.5.3", "bootstrap-select": "~1.12.1", "class-transformer": "~0.4.0", "core-js": "^3.6.5", "css-loader": "5.0.0", "dropzone": "~4.3.0", "handsontable": "^8.4.0", "html2canvas": "^1.0.0-rc.7", "jquery": "~3.1.1", "lodash-es": "^4.17.21", "moment": "^2.22.2", "ng-select2": "1.2.3", "ng2-signalr": "10.1.0", "ngx-bootstrap": "^6.2.0", "ngx-file-drop": "^11.1.0", "ngx-moment": "^3.2.0", "ngx-select-ex": "^3.6.7", "ngx-skeleton-loader": "^2.10.0", "ngx-toastr": "^12.1.0", "oidc-client": "1.8.2", "popper.js": "^1.16.1", "reflect-metadata": "~0.1.13", "rxjs": "~6.6.3", "select2": "^4.0.13", "select2-bootstrap-theme": "0.1.0-beta.10", "signalr": "^2.4.1", "tether": "^1.4.5", "text-mask-addons": "~3.6.0", "ts-helpers": "~1.1.1", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "~0.1102.19", "@angular/cli": "^11.2.19", "@angular/compiler-cli": "11.2.14", "@angular/language-service": "11.2.14", "@compodoc/compodoc": "1.1.18", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.6", "@types/jquery": "^3.3.32", "@types/lodash-es": "^4.17.4", "@types/node": "^12.12.26", "@types/puppeteer": "^5.4.4", "@typescript-eslint/eslint-plugin": "^4.22.1", "@typescript-eslint/eslint-plugin-tslint": "^2.22.0", "@typescript-eslint/parser": "^4.22.1", "codelyzer": "^6.0.0", "enhanced-resolve": "~3.3.0", "eslint": "^7.25.0", "eslint-plugin-sonarjs": "^0.5.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.1.0", "karma-cli": "^2.0.0", "karma-coverage-istanbul-reporter": "~3.0.3", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "karma-jasmine-seed-reporter": "^0.2.0", "karma-junit-reporter": "^2.0.1", "karma-scss-preprocessor": "^4.0.0", "protractor": "~7.0.0", "puppeteer": "^13.1.3", "ts-node": "~7.0.0", "typescript": "4.0.6" } }

I'm using node 10.13.0

NPM version 6.11.0

nschonni commented 1 year ago

Node 10 has been EOL for nearly 2 years