Posted at

Elmをインストールできないとき(Ubuntu)

More than 1 year has passed since last update.

sudo npm i -g elm --unsafe-perm=true --allow-rootでインストールできます。


環境

Ubuntu 16.04 LTS

npmがインストール済み


エラーメッセージ

$ sudo npm i -g elm@^0.18.0

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/usr/local/bin/elm -> /usr/local/lib/node_modules/elm/binwrappers/elm
/usr/local/bin/elm-make -> /usr/local/lib/node_modules/elm/binwrappers/elm-make
/usr/local/bin/elm-package -> /usr/local/lib/node_modules/elm/binwrappers/elm-package
/usr/local/bin/elm-reactor -> /usr/local/lib/node_modules/elm/binwrappers/elm-reactor
/usr/local/bin/elm-repl -> /usr/local/lib/node_modules/elm/binwrappers/elm-repl

> elm@0.18.0 install /usr/local/lib/node_modules/elm
> node install.js

Error extracting linux-x64.tar.gz - Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/elm/Elm-Platform'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! elm@0.18.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the elm@0.18.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/takeyuki/.npm/_logs/2017-09-30T09_26_44_798Z-debug.log


解決法

以下のコマンドでインストールできます。

sudo npm i -g elm --unsafe-perm=true --allow-root


参考

https://github.com/gdotdesign/elm-github-install/issues/21