4

错误:找不到所有 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
4

2 回答 2

7

meteor通过完全卸载/重新安装并meteorite通过以下步骤,我能够解决此错误。

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

于 2013-09-08T22:28:20.643 回答
0

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

npm update -g meteorite

如果您过去以 sudo 运行 'mrt' 或 'meteor' 命令,则会导致问题。通过运行清除陨石:

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

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

于 2013-09-08T08:35:05.650 回答