【问题标题】:"module.js:557 throw err" when running npm from terminal从终端运行 npm 时出现“module.js:557 throw err”
【发布时间】:2018-06-30 01:45:13
【问题描述】:

当我从终端运行 npm 时,我得到了这个错误,没有别的。没有 npm 命令正在工作,它们都给出了相同的错误,我什至无法安装依赖于 nodejs 的程序。

$ npm module.js:557 抛出错误; ^

错误:找不到模块“semver”

在 Function.Module._resolveFilename (module.js:555:15)

在 Function.Module._load (module.js:482:25)

在 Module.require (module.js:604:17)

在需要时(内部/module.js:11:18)

在对象。 (/usr/lib/node_modules/npm/lib/utils/unsupported.js:2:14)

在 Module._compile (module.js:660:30)

在 Object.Module._extensions..js (module.js:671:10)

在 Module.load (module.js:573:32)

在 tryModuleLoad (module.js:513:12)

在 Function.Module._load (module.js:505:3)

【问题讨论】:

标签: javascript node.js npm


【解决方案1】:

这对我有用(我使用的是 OSX)

sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf ~/.npm
brew uninstall --force node
brew install node

【讨论】:

  • 完美运行。
猜你喜欢
  • 1970-01-01
  • 2019-05-02
  • 2014-03-17
  • 2017-11-28
  • 2015-09-06
  • 1970-01-01
  • 1970-01-01
  • 2019-07-28
  • 2018-11-17
相关资源
最近更新 更多