我刚刚删除了 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/