Cb.apply is not a function

I am trying to install a package through the terminal because that is the only way and it keeps giving me this error

npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR! /app/.npm/_logs/2020-09-02T14_25_03_081Z-debug.log

Ive tried refreshing and basically everything!!!

What is the package name?

discord.js

when i run the npm install it comes up with cb.apply is not a function

Could this help?

I dont have access to node_modules as glitch disables it

You can. Add this a file called .gitignore with these contents to your project.

!node_modules

Ok! I will try that!

1 Like

I just added it! What do I do now?

Try this ^^^ and then try installing the package again.

I am still getting the same error

What happens when you try these steps:

  1. run npm cache clean --force
  2. Delete the node_modules directory
  3. Delete package-lock.json if there is one

?

I fixed it. All I did was go into VSC and fix some packages and create a new project!

3 Likes