skip to Main Content

Today when I using pnpm install command to install the react app dependencies, shows warning:

> pnpm install
 WARN  deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
 WARN  deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
 WARN  deprecated [email protected]: [email protected]
 WARN  deprecated [email protected]: 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
 WARN  deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
 WARN  deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.

all the warning was caused by third party dependencies, should I fixed it? I already tried to upgrade the third party package to the latest version. Or just ignore these warning?

2

Answers


    1. Open your project’s package.json file.

    2. Find the dependencies section and locate the packages mentioned in the warnings. For example

      "dependencies": {
      "svgo": "1.3.2",
      "rollup-plugin-terser": "7.0.2",
      // … other dependencies
      }
      //Change and save

      "dependencies": {
         "svgo": "^2.0.0", // Use the latest 2.x.x version
         "@rollup/plugin-terser": "^8.0.0", // Use the latest version of @rollup/plugin-terser
         //
      

    … other dependencies
    }

    Save the changes to your package.json file.

    Run the following command to install the updated dependencies:

    pnpm install
    
    Login or Signup to reply.
  1. These warnings are deprecated warnings from third-party dependencies. They say that the versions of the packages you are using are no longer supported or maintained. They may have feature break changes.

    You can update these packages, but you should have a full test to make sure everything works well.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search