错误:无法在控制台中找到所有Meteor命令的模块“下划线”

时间:2013-09-07 23:30:39

标签: javascript node.js meteor underscore.js meteorite

错误:无法在控制台中找到所有Meteor命令的模块“下划线”

在每个流星或陨石命令(例如meteormrt create myapp)之后,会抛出以下错误。这个错误似乎突然出现,因为流星在前一天晚上起作用,自那以后没有任何变化。

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

我尝试使用返回

sudo npm install -g underscore手动安装下划线
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有以下路径

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

我甚至尝试重新安装节点并执行npm cache clean,但我不确定还有什么可以尝试。

任何进一步的见解将不胜感激。

更新

正在运行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

2 个答案:

答案 0 :(得分:7)

我可以通过以下步骤完全卸载/重新安装meteormeteorite来解决此错误。

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 --versionmrt create test-app

,我能够验证所有内容是否正常运行

答案 1 :(得分:0)

首先,你的陨石已经过时了。更新陨石跑(sudo,如果适用):

npm update -g meteorite

如果您在过去使用'mrt'或'meteor'命令作为sudo运行it will cause issues。通过运行清除陨石:

sudo mrt uninstall
sudo mrt uninstall --system
sudo chown -R `whoami` ~/.npm

您还想删除位于'/project/.meteor/local/build'的现有项目中的'build'文件夹