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

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-cache_logs\2022-03-21T10_06_23_503Z-debug.log
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
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

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 thenode_modules
tree, orpackage.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 🙂
You must log in to post a comment.