Viji
@Viji
DevOps Engineer

Как обновить child dependency для frontend приложения?

Есть фронэнд приложение с package.json и package-lock.json. В package.json прописан webpack в качестве 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 прописан webpack в след виде

"@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 выходит ошибка c 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 - показывает, что его надо обновить до webpack@^5.1.0,  как требуется для copy-webpack-plugin@9.0.1

npm ERR! peer dep missing: webpack@^5.1.0, required by copy-webpack-plugin@9.0.1
npm ERR! peer dep missing: webpack@^5, required by string-replace-loader@3.0.3
npm verb exit [ 1, true ]
npm timing npm Completed in 4160ms
npm verb code 1


можете подсказать как это сделать?

и что делать со следующими строками?
"resolved": "https://nexus-server.internal.company.ru/repositor...",
"integrity": "sha512-GUHyYaAfzu4S14F+R5iGRwN632FRNJY7U0NilmFAqbsOfK6j1HwuLBAqwRIT+pVdNDJGJ6e8rpp0KHA==",
  • Вопрос задан
  • 49 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы