npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

cb() not called

I never changed the global install location, how do I go about fixing this because npm can get messy if theres bugs with it. I never had the time to dive into npm so I need step by step careful help. Do you think another piece of software might have come in and modified npm?

Also my ubuntu version is 16.04.5 LTS not any of the MAC OS, and if we fix npm there should be a glaring bug in the the software that started this mess in the first place


Yep we will eventually try with the source code because npm is a nasty problem to remove from the system, stuff is always lying around in the deepest parts of the OS making it difficullt to reinistall properly


well to update npm to the latest version

npm install -g npm --timing (so you can see the logs)

it claimed it updated to 6.11.2
but npm -v still says 6.9.0
2019-09-04T02_24_15_143Z-debug.log (137.1 KB)


/usr/bin/npm /usr/bin/node, are you familiar with Linux you might be making a misjudgement

/usr/bin /bin are where system wide commands are stored place where the OS uses PATH to look for relative-given executables,

Realizing this im now certain that there is one npm installation on my machine


Indeed, the npm documentation recommends avoiding the use of sudo for global installs.

In general your approaches for avoiding use of sudo with global package installs are:

Let’s follow through with the explicit prefix option then. You already have prefix explicitly set, and probably just need changes to your PATH. What does it currently look like?

echo $PATH


You have a prefix configuration in your user npm settings:

; userconfig /home/uoul/.npmrc
prefix = "/home/uoul/npm"

This changes where npm installs global packages, including when you use npm to install itself. Documentation:

You can confirm this another way by running the command I listed earlier:

npm prefix -g

There are two ways forward from here, you could delete the prefix and install global packages to the system location, or you could modify your PATH so that commands installed locally are found. (And it could be that PATH is already modified and it is just that you have npm in two locations.)

(A reason for installing global modules to your home folder is that so you don’t need to use sudo when installing or updating them. The node version managers often support this mode of operation, such as n and nvm.)


The debug log looks like you missed the zero off the end? But I was not able to reproduce the error, so likely does not explain the error.

There have been a lot of good bug fixes since npm 6.9.1, so if you are able to update npm I suggest update and try the command again.


I am the admin with full control
the formatting did not do anything heres the result form
npm config list

; cli configs
metrics-registry = “https://registry.npmjs.org/
scope = “”
user-agent = “npm/6.9.0 node/v10.16.3 linux x64”

; userconfig /home/uoul/.npmrc
prefix = “/home/uoul/npm”

; node bin location = /usr/bin/node
; cwd = /home/uoul
; HOME = /home/uoul
; “npm config ls -l” to show all defaults.


how do I toss out the prefix and redirect all npm related to the directory where its supoosed to go


To delete the prefix configuration setting:

npm config delete prefix


Then because you will be installing global packages to a system folder, you will need to use sudo to install global packages like:

sudo install -g npm


isnt using sudo bad, isnt there another way, mabye i followed a blog and did this to prevent from using sudo


cb() not called

I was looking for how to upadte my angular/cli when I called this. Also I went to npm support because my version was not updating properly, I got a nasty reply

npm outdated -g --depth=0

OS : Linux Ubuntu 16.04 LTS
node : 10.16.3
npm : 6.9.1

debug log

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘outdated’, ‘-g’, ‘–depth=’ ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose npm-session 46991ae97b6e38ca
5 timing npm Completed in 4870ms
6 error cb() never called!
7 error This is an error with npm itself. Please report this error at:
8 error https://npm.community


/home/uoul/bin:/home/uoul/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/uoul/npm/bin


do I have to modify my path it could wreak havoc, can I only just delete the system installed npm
without modifying path


since there are two npm installed on my machine how do i delete the system-installed one?

How did you install npm? (Package manager? Running a shell script to download tarball? Part of node, either through package manager or direct script?)

To see if it helps but let you revert, you could just rename the command which is currently found first on your PATH:
sudo mv /usr/bin/npm /usr/bin/npm.renamed


so the difference between local and global npm is if the command binarnies are in your path


In linux its unwise to modify system binanires becuase u never know what software is using it, (needs to be in the form installed) and might get mad and really teare down the server, even so when ever something is ‘installed’ its best to uninstall


since there are two npm installed on my machine how do i delete the system-installed one?


I do not know what your setup is or how it got there, but we can hopefully sort it out, one thing at a time.

  1. Do you control this machine? (i.e. is it appropriate that you change the version of npm installed globally?)

  2. What does this command show for you? (Format the output in your reply using “Preformatted text” by using the </> control.)

npm config list

(npm config lists config settings: https://docs.npmjs.com/cli/config)


You have /usr/bin before /home/uoul/npm/bin in PATH. This is ok for new package commands, but when you type npm you get the old one installed in the system location rather than the new one installed locally.

I see you have two other local folders at the front: /home/uoul/bin, and /home/uoul/.local/bin

I suggest you move /home/uoul/npm/bin to near the start too.

(Some people prefer not to override system binaries with locally installed binaries. So another approach is you could delete the system installed npm.)


There is information about manually removing npm here: https://docs.npmjs.com/misc/removing-npm.html#more-severe-uninstalling


we ran a shell script to install the tarball


The logs show you are running
/usr/bin/npm
but are installing npm global modules to
/home/uoul/npm

npm is itself a global npm module (!) so you now have two installed and are still running the old one.

Have you changed the global install location? e.g. On my Mac I see:

$ npm prefix -g
/usr/local
$ command -v npm
/usr/local/bin/npm