Microsoft 365 : SPFx / React JS – Resolving error while installing package – npm ERR! cb() never called! – Part 2

Error - ERR! cb() never called! while installing the package
Error - ERR! cb() never called! while installing the package

Hi All,

Greetings for the day!!!

In one of previous article we have discussed how to resolve below error

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cac

Error - ERR! cb() never called! while installing the package
Fig : Error – ERR! cb() never called! while installing the package

In first article we discussed how to resolve this error. React JS – Resolving error while using Fluent UI web components – npm ERR! cb() never called!

Solution we discussed in the given article is to clear the cache. Executing following command

npm cache clean --force 

NPM – cleaning the cache
Fig : NPM – cleaning the cache

But this time after clearing the cache as well issue is not resolved. Same error

After bit googling found that we need to on –no-package-lock as

npm install --no-package-lock

Turning on  --no-package-lock - npm install  --no-package-lock
Fig : Turning on –no-package-lock – npm install –no-package-lock

Once this command executed successfully, respective error is resolved and we could successfully install the packages

Bit Details :

  • The –no-package-lock will prevent npm from creating a package-lock
  • package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json
  • In version 5, npm introduced the package-lock.json file
  • package-lock.json keeps track of the exact version of every package that is installed
  • We should commit package-lock.json file so that other team member take get latest and installs packages the same versions of packages are installed which are referenced in package-lock.json file

Thanks for reading ! Feel free to discuss in case any question / suggestion / thoughts !


Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

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

%d bloggers like this: