2013-09-30 11 views
5

Trên Mac 10.8.5, khi tôi thử cài đặt PhoneGap vớicài đặt PhoneGap với NPM 1.3.11 tạo ra một mật khẩu: đường dẫn thư mục trên Mac OSX

sudo npm install -g phonegap 

hoặc sudo-ing và chạy

npm install -g phonegap 

tôi kết thúc với

/Users/eric/Password:/usr/local/bin/phonegap -> /Users/eric/Password:/usr/local/lib/node_modules/phonegap/bin/phonegap.js 
[email protected] /Users/eric/Password:/usr/local/lib/node_modules/phonegap 
├── [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], [email protected], [email protected], [email protected], [email protected], [email protected]) 

phiên bản của tôi về bash, nút và NPM là

bash-3.2# node --version 
v0.10.19 
bash-3.2# npm --version 
1.3.11 

Đây có phải là điều tôi có thể khắc phục tại dòng lệnh, bằng cách thêm công tắc hoặc xuất biến, hoặc có điều gì đó sai trong npm?

Cảm ơn.

+0

Tôi có vấn đề giống hệt nhau này. – Ben

Trả lời

8

Tắt một điều gì đó đặt tiền tố của tôi cho npm không chính xác; vẫn không chắc chắn về thủ phạm.

Nhưng để khắc phục điều này, tôi phải đảm bảo tiền tố khớp với đường dẫn cài đặt bị hỏng và tôi lại ở trong thư mục mẹ cho đường dẫn đó.

Ví dụ

cd /Users/eric 
npm set prefix /Users/eric/Password:/usr/local 
sudo npm uninstall phonegap -g 
sudo rm -rf Password\:/ 

Sau đó tôi đặt tiền tố mặc định cho OSX và chạy cài đặt lại

npm set prefix /usr/local 
npm install -g phonegap 
+1

Cảm ơn vì điều đó. Điều này đặt tôi đi đúng hướng vì cấu hình npm của tôi đã bị hỏng, trên Ubuntu. Tôi đọc điều này: https://www.npmjs.org/doc/misc/npm-config.html và tìm thấy tệp/usr/local/etc/npmrc có cài đặt thất thường trên mục nhập "tiền tố". PS: Tôi cũng đã cài đặt CLI phonegap, vì vậy vấn đề có thể có. – Greg

Các vấn đề liên quan