无法运行NPM获取错误:无法find模块“我们在那里”
我刚刚删除节点,并用自制软件重新安装。 我第一次安装没有npm。 然后删除该版本,并与npm安装节点。
安装成功,但现在我不能使用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命令我可以尝试。 我试图删除并重新安装节点与自制软件,但没有奏效。 请帮忙
UPDATE
我看到这个答案: npm不起作用,总是得到这个错误 – >错误:找不到模块'我们在那里'
但解决scheme没有奏效。 我什至没有文件夹
cd /usr/local/Cellar/node/0.10.22/lib/node_modules
在lib文件夹中没有node_modules。
甚至npm i npm -g
没有工作。
同样的问题,当我安装yarn
,尝试:
安装纱线
cd /usr/local/lib/node_modules/npm sudo yarn add are-we-there-yet
它对我来说工作得很好,希望这对你有帮助。
我遇到了同样的问题,请尝试:
cd /usr/local/lib/node_modules
相反,那么:
curl registry.npmjs.com/npm/-/npm-2.12.0.tgz |tar xz --transform="s:^package:npm:"
…和
npm i npm -g
通过删除节点的自制安装,然后使用安装程序直接从node.js网站安装,我再次获得了节点和NPM的工作。 这可能不是最好的答案,但它现在正在为我工作。
好吧,我在这两个小时的时间内,在我的切换跟踪器上挣扎着,并且有一个为我工作的解决scheme。 请注意,我不知道安装过程中导致这个错误,但各种简单的方法,如sudo apt-get安装nodejs,sudo apt-get安装npm会导致这个错误,我猜的forms不兼容/旧的软件包库。 从一个干净的安装这个安装顺序导致一个工作节点/ NPM安装,我可以进行如下:
sudo apt-get update sudo curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash – sudo apt-get install -y nodejs
这基本上是更新,然后按照以下指示: https : //github.com/nodesource/distributions
希望这有助于别人,不要把他们2小时:')
我几次遇到这个问题。 对于那些使用软件包n来pipe理节点安装的人,只需交换节点版本即可解决此问题。
例如,第一次运行
sudo n latest
然后运行
sudo n stable
(或者返回到希望使用的任何版本)。
如果这还没有解决它,然后运行
npm install -g npm
这是解决问题的最简单的方法,假设你使用n(我强烈build议任何使用节点的人)
要安装n,
npm install -gn
请注意,您可能无法安装n以解决此问题。 这个解决scheme只适用于那些已经安装了n的解决scheme。
也有这个错误。 什么对我有效:
- 删除/ usr / local / lib / node_modules
- 重新安装NodeJS:brew重新安装nodejs
完成!