npm Community Forum (Archive)

The npm community forum has been discontinued.

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

Unhandled rejection Error: Argument #2: Expected string but got null

I am suddenly getting this whenever I want to install anything, like npm install.
0 info it worked if it ends with ok 1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘install’ ] 2 info using npm@6.4.1 3 info using node@v10.12.0 4 verbose npm-session b078ec810e07dc1b 5 silly install runPreinstallTopLevelLifecycles 6 silly install loadCurrentTree 7 silly install readLocalPackageData 8 timing npm Completed in 3035ms 9 error cb() never called! 10 error This is an error with npm itself. Please report this error at: 11 error <>

Here’s what I have already tried that didn’t solve the issue:

It seems that when I ran the npm uninstall it did not actually remove all files. I manually removed all node-modules from my root directory and then reinstalled npm and now it works.