0

Please find my package.json file and jenkins build fail saying these issues. please help how to resolve these issues. npm version: 8.15.0. node version v16.17.1 i am trying to convert from react 16 to react 18 please help how to resolve these issues. npm version: 8.15.0. node version v16.17.1 i am trying to convert from react 16 to react 18

package.json
{

  "name": "testprj",

  "version": "0.1.0",

  "private": true,

  "dependencies": {

    "@ckeditor/ckeditor5-react": "^5.0.6",

    "axios": "^0.21.4",

    "bootstrap": "^4.1.3",

    "ckeditor5-build-classic-extended": "^20.0.1",

    "classnames": "^2.3.1",

    "dotenv": "^16.0.0",

    "env-cmd": "^10.1.0",

    "html-entities": "^2.3.3",

    "html-react-parser": "^3.0.4",

    "i": "^0.3.7",

    "jquery": "^3.4.1",

    "merge": "^1.2.1",

    "npm": "^8.18.0",

    "oidc-client": "^1.9.0",

    "react": "^18.2.0",

    "react-bootstrap": "^2.2.2",

    "react-dom": "^18.2.0",

    "react-html-parser": "^2.0.2",

    "react-router-bootstrap": "^0.25.0",

    "react-router-dom": "^5.1.2",

    "react-scripts": "^3.4.1",

    "react-tabs": "^4.2.0",

    "react-xml-parser": "^1.1.8",

    "reactstrap": "^8.4.1",

    "rechoir": "^0.8.0",

    "rimraf": "^2.6.2",

    "shelljs": "^0.8.5",

    "shx": "^0.3.4",

    "styled-components": "^5.3.5"

  },

  "devDependencies": {

    "ajv": "^6.9.1",

    "cross-env": "^5.2.0",

    "eslint": "^6.8.0",

    "eslint-config-react-app": "^5.2.0",

    "eslint-plugin-flowtype": "^4.6.0",

    "eslint-plugin-import": "^2.20.1",

    "eslint-plugin-jsx-a11y": "^6.2.3",

    "eslint-plugin-react": "^7.18.3",

    "nan": "^2.14.1"

  },

  "eslintConfig": {

    "extends": "react-app"

  },

  "scripts": {

    "start": "rimraf ./build && react-scripts start",

    "build:dev": "env-cmd -f .env.dev react-scripts build && shx rm -rf build-dev && shx cp -r build build-dev",

    "build:sit": "env-cmd -f .env.sit react-scripts build && shx rm -rf build-sit && shx cp -r build build-sit",

    "build:qa": "env-cmd -f .env.qa react-scripts build && shx rm -rf build-qa && shx cp -r build build-qa",

    "build:uat": "env-cmd -f .env.uat react-scripts build && shx rm -rf build-uat && shx cp -r build build-uat",

    "build:prod": "env-cmd -f .env react-scripts build && shx rm -rf build-prod && shx cp -r build build-prod",

    "build": "react-scripts build",

    "test": "cross-env CI=true react-scripts test --env=jsdom",

    "eject": "react-scripts eject",

    "lint": "eslint ./src/"

  },

  "browserslist": {

    "production": [

      ">0.2%",

      "not dead",

      "not op_mini all"

    ],

    "development": [

      "last 1 chrome version",

      "last 1 firefox version",

      "last 1 safari version"

    ]

  }

}

issues


npm install --legacy-peer-deps

npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility

npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated

npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.

npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies

npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.

npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()

npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added

npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'

npm WARN deprecated eslint-loader@3.0.3: This loader has been deprecated. Please use eslint-webpack-plugin

npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.

npm WARN deprecated html-webpack-plugin@4.0.0-beta.11: please switch to a stable version

npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'

npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

TestUser
  • 247
  • 1
  • 13
  • What's the issue? I see only warnings. Meanwhile, check some resources: https://stackoverflow.com/questions/35236735/npm-warn-message-about-deprecated-package https://docs.npmjs.com/cli/v6/commands/npm-audit – Jorge Vargas Apr 26 '23 at 12:34

1 Answers1

0

React 16 to 17 was a maintenance build (no breaking changes) and 17 to 18 introduced some changes that will only affect projects that use typescript. I see your package.json doesn't have one. What you're seeing in console are deprecation warnings, these won't affect a local run but if Jenkins has been configured to treat warnings as errors, build on Jenkins will fail.

If this build is for a pre-prod environment and you NEED to push this build, search for the setting - something on the lines of break build if warnings more than specified count or break build if warnings are more than warnings from last check-in. If the Jenkins configuration is old, there might also be a, now deprecated, Warnings plugin in the pipeline that may cause build to fail on warnings.

Else you can try to resolve dependency warnings one by one, which may actually break your build and even lead to something called a "Dependency Hell" since all these dependency warnings require major updates.

bot15
  • 38
  • 4