Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

424
Vistas
npm ERR! cb.apply is not a function

I am getting this error

npm ERR! cb.apply is not a function

in Linux while doing npm install although my npm version is 6.9.0. My node version is v12.18.3. How to resolve this issue?

over 4 years ago · Santiago Trujillo
16 Respuestas
Responde la pregunta

0

Solution for ubuntu =>

  1. Completely remove nodejs and npm from your system.
sudo apt-get remove nodejs
sudo apt-get remove npm
  1. Install node from this reference (https://computingforgeeks.com/install-node-js-14-on-ubuntu-debian-linux/) - This will inturn install latest npm .
over 4 years ago · Santiago Trujillo Denunciar

0

Would be helpful if you shared if it's Windows or Linux, but the error seems to occur on Windows. Possible solution:

1. Go to C:\Users(your username)\AppData\Roaming
2. Delete the npm folder (possibly back it up) and if there is one npm cache folder.
3. Run `npm cache clear --force` (--force is now required to clean cache)

After that, npm install should work fine.

over 4 years ago · Santiago Trujillo Denunciar

0

Ciao, this problem could be connected to graceful-fs package. You could try to reinstall it:

npm install graceful-fs --save-dev
over 4 years ago · Santiago Trujillo Denunciar

0

Solution for Ubuntu 18.04=>

  1. Visit 'usr/lib/node_modules'.
  2. Delete 'n', 'npm','npm-clean','npm-install-peers'. That means delete all the node & npm related folders.
  3. Install the npm again.
over 4 years ago · Santiago Trujillo Denunciar

0

I had the same issue with Nodist. After changing my Node version, my npm version was actually incompatible with it. So if you're using Nodist, make sure to run nodist npm {scope} match after switching Node versions, where scope is either global, local or env.

over 4 years ago · Santiago Trujillo Denunciar

0

I have tried a lot of solutions from different posts and google pages and nothing worked for me.

I ended up cleaning all traces of node, nodejs, and npm. May need some manual force remove after the purge call. And then installed using nvm.

https://linuxize.com/post/how-to-install-node-js-on-ubuntu-20-04/#installing-nodejs-and-npm-using-nvm

And it resolved the issue for me. It got the nodejs v 15.4.0 and the compatible version of npm 7.0.15 ( before using apt-get it was installing npm 6.9.0)

over 4 years ago · Santiago Trujillo Denunciar

0

In my case it was indeed the graceful-fs package. Running

npm i -g --force graceful-fs 

fixed the issue. I also ran nodist npm {scope} match before but I'm unsure if it was neccessary.

over 4 years ago · Santiago Trujillo Denunciar

0

solution for ubuntu 18.04

sudo apt-get remove nodejs
sudo apt-get remove npm
sudo rm /usr/local/bin/node
sudo rm /usr/local/bin/npm
sudo apt-get install nodejs
sudo apt-get install npm

And try node and npm version

node -v
npm -v

If it says there is no such node/npm after you already install, then

sudo ln -s /usr/bin/node /usr/local/bin/node
sudo ln -s /usr/bin/npm /usr/local/bin/npm

Try if the command works

npm -v
node -v

In case when you want to update npm/node stable version

sudo npm install n -g
sudo n stable
over 4 years ago · Santiago Trujillo Denunciar

0

solution for Windows:

in my case i didn't want to delete all the npm directory inside "C:/users/me/AppData/Roaming/" because i had there many global modules that is already exist and installed.

what worked inspired by @user14360499 above:

  1. go inside "C:\Users\me\AppData\Roaming\npm\node_modules"
  2. delete the 'npm' dir
  3. npm install my project, and keep working as usually
over 4 years ago · Santiago Trujillo Denunciar

0

Mac/Macbook users

Since this question is fairly active and a top google result for this issue (I know the OP is using Linux) and we have every other OS covered in this list. Here is how to fix it on a Mac.

On a Mac you do not have the AppData\Roaming folder, so simply run npm root -g and then navigate to the hidden directory and delete the node_modules there. If using nvm you'll need to rerun nvm use x.x.x (where x.x.x is your version).

over 4 years ago · Santiago Trujillo Denunciar

0

I had this problem while trying to run npx.

I found that nvm had been removed from the PATH.

I added it back to my .zshrc file and it worked.

over 4 years ago · Santiago Trujillo Denunciar

0

Feb 2021 fix:

npm install

And then commit the changes to package-lock.json. That should update all your dependencies, thus fixing this issue.

More info: https://help.heroku.com/ZV7S7D6T/why-is-my-node-build-is-suddenly-displaying-npm-err-cb-apply-is-not-a-function (this happened to me on heroku)

over 4 years ago · Santiago Trujillo Denunciar

0

For linux users:

  1. uninstall NPM, to do it go to /usr/local/lib/node_modules and do:

sudo rm -r n npm npx

  1. Once uninstalled, re-instal it:

npm install

  1. Even after doing this, in a specific project when trying to install a specific npm package, you may get the following error:

bash: /usr/local/bin/npm: No such file or directory

If so, in the terminal just run:

hash -r

  1. Now you can retry installation of your wanted npm package.
over 4 years ago · Santiago Trujillo Denunciar

0

On macOS BigSur, I had this problem when executing:

npx install-peerdeps --dev eslint-config-airbnb

To fix, I ran

brew update

after which I was prompted to run

brew upgrade

Running the two commands fixed the issue.

over 4 years ago · Santiago Trujillo Denunciar

0

In my case (Mac) it was because I had npx installed alongside n (alternative to nvm).

$ which npx
/usr/local/bin/npx

I removed this exectutable and now:

$ which npx
/Users/MY_USER/n/bin/npx

and it works now.

over 4 years ago · Santiago Trujillo Denunciar

0

Had the same error was simply in the wrong folder -.- (not a typescript project)

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda