close

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

While trying to run npm install in my nodejs project I am facing the following error npm ERR! cb.apply is not a function. So in this article, we are going to discuss all about these errors and possible ways to fix this error.

How to solve npm ERR! cb.apply is not a function error?

  1. npm ERR! cb.apply is not a function

    To solve npm ERR! cb.apply is not a function error to resolve this issue is to install the graceful-fs package by running this command: npm install graceful-fs –save-dev Or You can install it globally: npm i -g –force graceful-fs And now, your error will be resolved.

  2. How to solve npm ERR! cb.apply is not a function error?

    To solve npm ERR! cb.apply is not a function error You just need to delete your NPM folder in your roaming 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 Now, open the terminal from the root of your project and run this command: npm install And now, Your error will be solved. Thanks.

Solution 1: Delete npm folder

To solve npm ERR! cb.apply is not a function error You just need to delete your NPM folder in your roaming 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

And now, Your error will be solved. Thanks.

Solution 2: install graceful-fs

The second approach to resolve this issue is to install the graceful-fs package by running this command.

npm install graceful-fs --save-dev

Or You can install it globally.

npm i -g --force graceful-fs 

And now, your error will be resolved.

Conclusion

It’s all About this error. I hope We Have solved Your error. Comment below Your thoughts and your queries. Also, Comment below on which solution worked for you.

Also, Read

Leave a Comment