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! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cac
he_logs\2022-03-21T10_06_23_503Z-debug.log

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 !

HAVE A FANTASTIC TIME AHEAD 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading