npm is broken and i can not run any npm command

You're facing this issue. The short solution seems to be:

Delete node_modules/npm and then run yarn install again.

There are other solutions in the issue comment thread.


For windows, delete node_modules from the following path - C:\Program Files\nodejs\node_modules


In windows i was getting the same error

log.progressEnabled = log.gauge.isEnabled()

npm version is 6.13.4, i installed the @angular/cli for MVC development with asp.net core with angular.

I changed the 57 line from log.js C:\Users\<>\AppData\Roaming\nvm\v6.9.5\node_modules\npm\node_modules\npmlog\log.js

from

log.progressEnabled = log.gauge.isEnabled() to

log.progressEnabled = log.gauge.isEnabled

and npm started to work.