[Solved] npm ERR! cb.apply is not a function

While are you trying to run npm install in your project. Then you may see an error that says “npm ERR! cb.apply is not a function”.

In this article, you’ll learn everything about this npm ERR! cb.apply is not a function Error in NodeJs. And how to resolve the error all the possible solutions with examples.

How To npm ERR! cb.apply is not a function Occurs?

Most of the time you get this error While running npm install. then you will face this error.

How to Fix npm ERR! cb.apply is not a function Error?

There are different ways to fix npm ERR! cb.apply is not a function this error. Let us take a look at every solution.

  • How to Fix npm ERR! cb.apply is not a function Error?

To Solve this npm ERR! cb.apply is not a function Error to resolve this issue install the graceful-fs by running this command: npm install graceful-fs –save-dev Or you can globally install by running this command: npm i -g –force graceful-fs And then your error will be solved.

  • npm ERR! cb.apply is not a function

To fix this Error you just to need delete your npm folder. First of all, open your Appdata/Roaming directory probably it should be at C:\Users\your_username\AppData\Roaming and then Delete npm folder. Now Open your terminal and run this cache clear command. Now your error will be gone.

Solution 1: install graceful-fs

First you have to install graceful-fs by below the command.

npm install graceful-fs --save-dev

Or you can install it globally.

npm i -g --force graceful-fs 

Now your error will be solved.

Solution 2: Delete npm folder

First of all, open your Appdata/Roaming directory probably it should be at C:\Users\your_username\AppData\Roaming and then Delete npm folder. Now Open your terminal and run this cache clear command.

npm cache clear --force

Or

npm cache clean -f

Now, open the terminal from the root of your project and run this command.

npm install

Now, Your error will be gone.

Conclusion

In this article, we have discussed what causes the error and we have discussed ways to fix the error.

we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Categories