错误:无法在控制台中找到所有Meteor命令的模块“下划线” [英] Error: Cannot find module 'underscore' thrown in console for all Meteor commands

查看:79
本文介绍了错误:无法在控制台中找到所有Meteor命令的模块“下划线”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:在所有Meteor命令的控制台中找不到模块'下划线'

在每个流星或陨石命令之后,如 meteor mrt create myapp 引发以下错误。这个错误似乎突然出现,因为流星在前一天晚上起作用,并且此后没有任何变化。

After every meteor or meteorite command such as meteor or mrt create myapp the following error is thrown. This error seemed to appear suddenly, as meteor was functional the night before and no changes have been made since.

Austins-MacBook-Pro:Projects austinrivas$ mrt create test-app

/Users/austinrivas/.meteor/tools/3cba50c44a/tools/meteor.js:1480
}).run();
   ^
Error: Cannot find module 'underscore'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at /Users/austinrivas/.meteor/tools/3cba50c44a/tools/meteor.js:10:11

我尝试用<手动安装下划线code> sudo npm install -g下划线返回

Austins-MacBook-Pro:Projects austinrivas$ sudo npm install -g underscore
Password:
npm http GET https://registry.npmjs.org/underscore
npm http 200 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz
npm http 200 https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/cordova requires colors@'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/node-static requires colors@'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
underscore@1.5.2 /usr/local/share/npm/lib/node_modules/underscore

我的〜/ .bash_profile有以下路径

My ~/.bash_profile has the following paths

export PATH=/usr/local/share/npm/bin:$PATH
export NODE_PATH="/usr/local/share/npm/lib/node_modules"
export NODE_OPTIONS="--debug"

我甚至尝试重新安装节点并且做一个 npm缓存但是我不确定还有什么可以尝试。

I've even tried reinstalling node and doing an npm cache clean but I'm not sure what else to try.

任何进一步的见解都将是赞赏。

Any further insight would be appreciated.

更新

运行 npm list -g underscore 返回以下内容

Austins-MacBook-Pro:~ austinrivas$ npm list -g underscore
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/cordova requires colors@'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/node-static requires colors@'>=0.6.0' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/phonegap/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
/usr/local/share/npm/lib
├─┬ meteorite@0.6.11
│ ├─┬ ddp@0.3.4
│ │ └─┬ meteor-ejson@0.6.3
│ │   └── underscore@1.4.4
│ └── underscore@1.5.1
├─┬ phonegap@3.0.0-0.14.0
│ └─┬ cordova@3.0.0
│   ├─┬ follow-redirects@0.0.3
│   │ └── underscore@1.5.1
│   └─┬ plugman@0.9.10
│     ├─┬ dep-graph@1.1.0
│     │ └── underscore@1.2.1
│     └── underscore@1.4.4
├── underscore@1.5.2
└─┬ ungit@0.1.8
  └── underscore@1.4.4


推荐答案

我能够解决这个问题通过以下步骤完全卸载/重新安装 meteor meteorite 时出现错误。

I was able to resolve this error by completely uninstalling / reinstalling meteor and meteorite through the following steps.

sudo rm /usr/local/bin/meteor
rm -rf ~/.meteor
sudo mrt uninstall
sudo mrt uninstall --system
sudo chown -R `whoami` ~/.npm
curl https://install.meteor.com | /bin/sh
sudo -H npm install -g meteorite

我能够验证一切运行正常,运行 meteor --version mrt create test-app

I was able to verifying everything was working properly by running meteor --version and mrt create test-app

这篇关于错误:无法在控制台中找到所有Meteor命令的模块“下划线”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆