2013-07-23 30 views
6

Tôi đang cố gắng tải xuống và chạy PhoneGap. Tôi đã thử trên 3 máy (2 mac, 1 cửa sổ), và tôi không thể không cảm thấy như thể tôi đang làm gì đó sai.PhoneGap - Không thể cài đặt qua npm, phonegap không tồn tại

Tôi đã cài đặt nodeJS (v0.10.13) và NPM (1.3.2) cho các phiên bản mới nhất, sử dụng homebrew.

Để cài đặt PhoneGap tôi thực hiện như sau qua dòng lệnh: sudo npm install -g phonegap

NPM đi trên đó là cách vui vẻ tải một tấn của các gói và cài đặt tất cả mà không cảnh báo hoặc lỗi.

Sau khi cài đặt tôi nhận được những điều sau đây, mà tôi giả định là đúng:

npm http 200 https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz 
/usr/local/share/npm/bin/phonegap -> /usr/local/share/npm/lib/node_modules/phonegap/bin/phonegap.js 
[email protected] /usr/local/share/npm/lib/node_modules/phonegap 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── s[email protected] 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
MikeBook-Pro:apps Mike$ 

tôi sau đó khởi động lại thiết bị đầu cuối (hoàn toàn bỏ nó, cmd + q) và chạy phonegap, để được chào đón với:

MikeBook-Pro:~ Mike$ phonegap 
-bash: phonegap: command not found 

Tôi đang kết thúc ở đây. Tôi đã cài đặt các công cụ khác thông qua NPM mà không có vấn đề gì. /etc/paths của tôi trông giống như sau:

/usr/bin 
/bin 
/usr/sbin 
/sbin 
/usr/local/bin 

Tôi đã làm theo các bước ở trên sử dụng cordova thay vì phonegap, nhưng than ôi; cùng một vấn đề.

Bất kỳ trợ giúp nào được đánh giá cao, tôi chỉ muốn khóc.

Edit: Tôi hiện đang cố gắng này trên OSX 10.8.2 (Mountain Lion)

Trả lời

5

tôi là một số cách thiếu một vài đường dẫn từ file /etc/paths tôi. Bên dưới là tệp mới:

/usr/bin 
/bin 
/usr/sbin 
/sbin 
/usr/local/bin 

/usr/local/share 
/usr/local/share/npm 
/usr/local/share/npm/lib/node_modules/ 
/usr/local/share/npm/bin 
.npm 
Các vấn đề liên quan