開発したアプリなど一覧

Ubuntu に nodejs/npm を入れようとしたら "npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed" と言われた

アフィリエイトリンクを含む場合があります

昔から使っているサーバーをメンテナンスして新たな Web アプリを動かすために nodejs と npm を入れようとしたら、以下のようなエラーが発生した。

$ sudo apt install -y nodejs npm 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: npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

npm を入れるには node-gyp が必要のようだ。調べてみると他にもいくつか必要なパッケージがあるようで一緒に apt でインストールしてやる。

$ sudo apt install nodejs-dev node-gyp libssl1.0-dev

これで再度 nodejs と npm をインストールする。

$ sudo apt-get install nodejs npm (省略)

インストールできたら動作確認。

$ nodejs -v v8.10.0

動いた。多少(どころかかなり)バージョンが古いがとりあえずヨシ。

参考にしたページ:

apt - npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed - Ask Ubuntu

Sponsored Link

コメント

タイトルとURLをコピーしました