fix deprecated npm package

FIX: Outdated NPM packages (deprecated) in node JS project

Loading

Ranging from an ionic app, react native app, react or angular or any Node JS project. The warning message you received from NPM indicates that the version of the core-js package installed in your project (2.6.12) is deprecated and no longer recommended for usage due to various issues. It advises upgrading your dependencies to the basic version of core-js to avoid potential performance and compatibility problems.

Below is a snapshot of the error message;

npm WARN deprecated [email protected]: 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.

Update the npm dependencies in your package.json file to use the latest versions of the packages that depend on core-js. You can manually edit the package.json file and change the version numbers, or you can use the following command to update the dependencies automatically

In my case, I needed to update core-js and node-sass

just remove your package-json.lock and edit the core-js and node-sass to the latest version.

Forcing npm to use the legacy peer dependencies resolution mechanism is done by adding the --legacy-peer-deps parameter. Peer dependencies are those that a package needs but that the package’s consumer is expected to install independently. By telling npm to utilise an older algorithm to resolve conflicts between peer dependencies, you may tell it to use the --legacy-peer-deps flag.

Moreover, Sass (Syntactically Awesome Style Sheets) which is a popular CSS preprocessor will instruct the system to translate Sass code into standard CSS by issuing this command.

Run the command below to achieve this;

 npm update --legacy-peer-deps && sass

Once this is done. You are good to go!

Note: SVN Fix Trac Error: No node at revision WP Plugin

Loading


Comments

One response to “FIX: Outdated NPM packages (deprecated) in node JS project”

  1. Wow!! Thank you so much! Awesome content, as always.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.