Tôi đang thử cài đặt Node.js trên Ubuntu 12.10, nhưng thiết bị đầu cuối cho tôi thấy lỗi về các gói bị mất. Tôi đã thử với điều này:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
Nhưng khi tôi đến dòng cuối cùng sudo apt-get install nodejs npmcho thấy lỗi này:
Failed to install some packages. This may mean that
you requested an impossible situation or if you are using the distribution
distribution that some required packages have not yet been created or been
been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nodejs: Conflicts: npm
E: Failed to correct problems, you have held broken packages.
Sau đó, tôi gỡ cài đặt ppa:chris-lea/node.jsvà tôi đang thử một tùy chọn thứ hai:
sudo apt-get install node.js
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
Lỗi tương tự, thiết bị đầu cuối nói npm is the latest versionnhưng cũng hiển thị cho tôi văn bản tôi hiển thị ở trên cùng. Tôi nghĩ vấn đề là thế ppa:chris-lea/node.jsnhưng tôi không biết giải quyết nó như thế nào.
gruntvà nodelệnh của tôi không hiển thị bất kỳ lỗi, trợ giúp hoặc thông tin phiên bản nào. Tôi đã làm theo các bước trong câu trả lời này , và chắc chắn loại bỏ nodevà nodejsđầu tiên. Sau đó, tôi cài đặt chỉ nodejs , mà làm việc.