asdf-nodejs icon indicating copy to clipboard operation
asdf-nodejs copied to clipboard

empty output from npm commands

Open mcandre opened this issue 1 year ago • 0 comments

When I try common Internet shell snippets to quickly delete all my (global) NPM packages, then npm becomes corrupted. Commands like npm install [-g] and npm ls [-g] no longer produce any output, though they do quietly emit non-zero exit codes.

https://stackoverflow.com/questions/9283472/command-to-remove-all-npm-modules-globally

  • npm commands should not fail quietly, but always emit an error trace (to stderr). Between asdf-nodejs, plain NPM, and the questionable behavior of dozens of these snippets, not sure where the root cause of the NPM corruption lies.
  • NPM should implement a built-in command to automate deleting all packages. The fact that we have so many (failed) attempts by users to write portable, awk hacks to do this demonstrates the need for a built-in feature.

As a workaround, I am using asdf uninstall nodejs <version>, asdf install (from .tool-versions) to fix the corruption.

mcandre avatar Sep 26 '24 02:09 mcandre