Not able to run any npm command due to following error - Error: Cannot find module 'semver'

Not able to run any npm command due to following error - Error: Cannot find module 'semver'

终于解决了,我认为下面的过程有效。

  • 已从 usr 文件夹中删除 npm 模块
  • 我删除了 npm 模块
  • 清除缓存
  • 已安装 npm

& 成功了

我犯的错误是没有清除缓存