更新 我在系统内搜索了cordova,发现:
/Users/mbp13/.cordova/lib/ios/cordova
/Users/mbp13/.cordova/lib/ios/cordova/3.3.0/bin/templates/scripts/cordova
/Users/mbp13/.npm/connect-phonegap/0.10.0/package/lib/middleware/cordova
/Users/mbp13/.npm/connect-phonegap/0.10.0/package/res/middleware/cordova
/Users/mbp13/.npm/cordova
/Users/mbp13/.npm/cordova/3.4.1-0.1.0/package/bin/cordova
/usr/local/lib/node_modules/phonegap/node_modules/.bin/cordova
/usr/local/lib/node_modules/phonegap/node_modules/connect-phonegap/res/middleware/cordova
/usr/local/lib/node_modules/phonegap/node_modules/cordova
/usr/local/lib/node_modules/phonegap/node_modules/cordova/bin/cordova
/usr/local/lib/node_modules/phonegap/node_modules/cordova/e2e/fixtures/platforms/android/cordova
/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/spec/projects/android_one/cordova
/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/spec/projects/android_one/cordova/lib/cordova
/usr/local/share/npm/bin/cordova
/usr/local/share/npm/lib/node_modules/cordova
/usr/local/share/npm/lib/node_modules/cordova/bin/cordova
/usr/local/share/npm/lib/node_modules/phonegap/node_modules/.bin/cordova
/usr/local/share/npm/lib/node_modules/phonegap/node_modules/connect-phonegap/lib/middleware/cordova
/usr/local/share/npm/lib/node_modules/phonegap/node_modules/connect-phonegap/res/middleware/cordova
/usr/local/share/npm/lib/node_modules/phonegap/node_modules/cordova
/usr/local/share/npm/lib/node_modules/phonegap/node_modules/cordova/bin/cordova
我用:
sudo npm install -g cordova
在我的Mac上安装cordova,这是生成的命令行的最后几行。
npm http GET https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz
npm http 200 https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz
/usr/local/share/npm/bin/cordova -> /usr/local/share/npm/lib/node_modules/cordova/bin/cordova
cordova@3.4.1-0.1.0 /usr/local/share/npm/lib/node_modules/cordova
├── mime@1.2.11
├── q@0.9.7
├── semver@2.0.11
├── underscore@1.4.4
├── plist-with-patches@0.5.1 (xmlbuilder@0.4.3, xmldom@0.1.19)
├── shelljs@0.1.4
├── optimist@0.6.0 (wordwrap@0.0.2, minimist@0.0.8)
├── xcode@0.6.6 (node-uuid@1.3.3, pegjs@0.6.2)
├── elementtree@0.1.5 (sax@0.3.5)
├── npmconf@0.1.13 (once@1.3.0, inherits@2.0.1, osenv@0.0.3, ini@1.1.0, mkdirp@0.3.5, nopt@2.2.0, config-chain@1.1.8)
├── tar@0.1.19 (inherits@2.0.1, block-stream@0.0.7, fstream@0.1.25)
├── request@2.21.0 (json-stringify-safe@4.0.0, aws-sign@0.3.0, forever-agent@0.5.2, qs@0.6.6, tunnel-agent@0.3.0, oauth-sign@0.3.0, cookie-jar@0.3.0, node-uuid@1.4.1, http-signature@0.9.11, hawk@0.13.1, form-data@0.0.8)
└── plugman@0.21.0 (bplist-parser@0.0.5, nopt@1.0.10, dep-graph@1.1.0, rc@0.3.0, glob@3.2.9, request@2.22.0, npm@1.3.4)
所以我按照输出信息进入了文件夹/ usr / local / share / npm / lib / node_modules 但是没有Cordova唯一的电话空白。我还尝试了另一个文件夹/ usr / local / share / npm / bin /,但在它下面我也找不到cordova,PhoneGap就是它下面的那个。
请帮我告诉我如何在Mac上正确安装cordova。
谢谢