V
V
Vadim2021-08-03 15:15:00
npm
Vadim, 2021-08-03 15:15:00

How to update child dependency for frontend application?

Hello everyone,

I have a frontend app with package.json and package-lock.json. package.json has webpack as a child-dependency:

{
  "name": "main-host-app",
  "version": "1.1.0",
  "description": "Main Host Application",
  "main": "root.js",
  "dependencies": {
    "@babel/core": "7.11.4",
    "@babel/preset-env": "^7.12.1",
    "@datadog/browser-rum": "^1.25.2",
    "@internal/project_nes-404-component-v01-pkg": "^1.0.244",
    "@internal/project_nes-serra-component-v01-pkg": "^1.0.329",
    "@internal/project_nes-serra-component-v00-pkg": "^0.0.996",
    "@internal/project_nes2-auth-signin-component-v01-pkg": "^1.0.6",
    "@internal/project_nes2-auth-signup-component-v01-pkg": "^1.0.8",
    "@internal/project_nes2-layout-footer-component-v01-pkg": "^1.0.6",
    "@internal/project_nes2-layout-header-component-v01-pkg": "^1.0.8",
    "@internal/project_nes2-holder-component-v01-pkg": "^1.0.3",
    "@internal/project_nes2-temp-login-component-v01-pkg": "^1.0.4",
    "aws-sdk": "2.958.0",
    "axios": "0.21.1",
    "core-js-bundle": "^3.7.0",
    "css-loader": "^4.2.2",
    "eev": "^0.1.5",
    "import-map-overrides": "^1.16.1",
    "npm-check-updates": "^11.8.3",
    "npm-force-resolutions": "0.0.10",
    "popper.js": "^1.16.1",
    "rxjs": "^6.6.3",
    "single-spa": "^5.9.1",
    "style-loader": "^1.2.1",
    "systemjs": "^6.7.1",
    "trim-newlines": "4.0.2",
    "webpack": "^4.44.1",
    "zone.js": "0.10.3"
  },
  "scripts": {
    "start": "node node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev-local.js",
    "config": "node ./set-env.js",
    "build": "node node_modules/webpack/bin/webpack.js --config webpack.config.js -p",
    "lint": "eslint . --ext .js --fix",
    "test": "echo \"Error: no test specified\" && exit 1",
    "preinstall": "npx npm-force-resolutions"
  },
  "resolutions": {
    "trim-newlines": "4.0.2",
    "merge": "2.1.1",
    "glob-parent": "6.0.1",
    "axios": "0.21.1",
    "copy-webpack-plugin": "^9.0.1",
    "node-fetch": "2.6.1",
    "aws-sdk": "2.814.0",
    "semver-regex": "3.1.2",
    "acorn": "7.1.1"
  }
}


Package-lock.json contains webpack as follows

"@types/webpack": {
      "version": "4.41.30",
      "resolved": "https://nexus-server.internal.company.ru/repository/npm-group/@types/webpack/-/webpack-4.41.30.tgz",
      "integrity": "sha512-GUHyYaAfzu4S14F+R5iGRwN632FRNJY7U0NilmFAqbsOfK6j1HwuLBAqwRIT+pVdNDJGJ6e8rpp0KHA==",
      "dev": true,
      "requires": {
        "@types/node": "*",
        "@types/tapable": "^1",
        "@types/uglify-js": "*",
        "@types/webpack-sources": "*",
        "anymatch": "^3.0.0",
        "source-map": "^0.6.0"
      },
      "dependencies": {
        "anymatch": {
--
          "integrity": "sha512-UjbMhkBgzT7Ykc5YXUT46F0ila8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
          "dev": true
        }
      }
    },


npm build command gives webpack
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! build: `node node_modules/webpack/bin/webpack.js --config webpack.config.js -p`
npm ERR! Exit status 1
npm ERR! Failed at build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

-----------
npm ls webpack - shows it needs to be updated to [email protected]^5.1.0 as required by [email protected]

npm ERR! peer dep missing: [email protected]^5.1.0, required by [email protected]
npm ERR! peer dep missing: [email protected]^5, required by [email protected]
npm verb exit [ 1, true ]
npm timing npm Completed in 4160ms
npm verb code 1

can you tell me how to do this?

and what to do with the following lines?
"resolved": " https://nexus-server.internal.company.ru/repositor... ",
"integrity": "sha512-GUHyYaAfzu4S14F+R5iGRwN632FRNJY7U0NilmFAqbsOfK6j1HwuLBAqwRIT+pVdNDJGJ6e8rpp0KHA==",

all the best,
Vadim

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question