node.js - 无法运行 NPM 获取错误 : Cannot find module 'are-we-there-yet'

标签 node.js npm homebrew

我刚刚删除了 Node,然后用 Homebrew 软件重新安装了它。我第一次安装时没有使用 npm。然后删除该版本并使用 npm 安装 Node 。

安装成功,但现在我无法使用 NPM。

我在 NPM 上尝试的任何事情都会出错

module.js:338
    throw err;
    ^

Error: Cannot find module 'are-we-there-yet'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:2:16)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

我完全不知道该尝试什么。没有我可以尝试的 npm 命令。我尝试使用 Homebrew 软件删除并重新安装 Node ,但这不起作用。请帮忙

更新

我看到了这个答案:npm doesn't work, get always this error -> Error: Cannot find module 'are-we-there-yet'

但解决方案无效。我连文件夹都没有

cd/usr/local/Cellar/node/0.10.22/lib/node_modules

在 lib 文件夹中没有 node_modules。

甚至 npm i npm -g 也没有用。

最佳答案

同样的问题,当我安装 yarn ,尝试:

安装yarn

cd /usr/local/lib/node_modules/npm

sudo yarn add are-we-there-yet

它对我来说工作正常,希望这对你有帮助。

关于node.js - 无法运行 NPM 获取错误 : Cannot find module 'are-we-there-yet' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32765691/

相关文章:

javascript - Nodejs Router 需要函数但得到一个对象

meteor - choco Meteor 安装 - 自定义/不同的安装位置

gcc - 在 OS X 10.10 上brew install gcc49(无法找到可用的 ISL)

node.js - 如何在 TypeScript 项目中使用 js-cookie?

python - 面向初学者的关于 OSX 上的 Python 包管理的常识性建议

python - 在 Mac 上安装 pyqt (v4.8) 时出错

javascript - Node : One Global EventEmitter or every module it's own?

javascript - node.js cron 是否影响系统性能

javascript - Node.js - https.get() 和 JSON.parse() 使服务器崩溃

node.js - 在 npm publish 上更改根目录