我做了以下步骤:
git clone https://github.com/nibtehaz/NORTH-app.git
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install # which caused the following error
得到了
The following packages have unmet dependencies:
nodejs : Conflicts: npm
npm : Depends: node-gyp (>= 3.6.2~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我做了建议,但它导致了另一个问题:
sudo apt install node-gyp
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
node-gyp : Depends: libnode-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages
我错过了什么?
4条答案
按热度按时间ifmq2ha21#
对于Ubuntu 18.x和20.04,它是这样做的:
omtl5h9j2#
如果您在Ubuntu 20.04中遇到此问题,请执行以下操作:
Check this
m528fe3b3#
当我试图在基于buster的docker容器中安装
nodejs
和npm
时,我遇到了同样的事情。现在看来,您需要安装
yarn
,这将需要npm
。解为
apt-get install nodejs yarn
。然后,
npm
命令工作。t9aqgxwy4#
在Ubuntu 22.04上安装Node 18和yarn: