haiju's 開発メモ

開発に必要な情報を自分用にメモ

CentOS7.3にインストールしたNode.jsにくっついてきたnpmでpurescriptのインストールにコケる【調査中】

1つ前の記事でインストールしたNode.js v8.9.3についてきた

npm 5.5.1で試しにPurescriptをインストールしようとしたら

エラーでインストールできなかったので、暇な時間に調査

予定w

[エラー内容: 1回目]

% npm install -g purescript pulp bower
npm WARN deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2017-12-13T06_41_42_184Z-debug.log

[エラー内容: 2回目]

管理者権限がないからエラーなのかと軽く考えて、sudo を付けて実行して

みたが、更に大量のエラーがwww

※何か、Haskellとは別言語のはずだと思ってたけど、Haskell関係の

 キーワードが大量に出ているような気が?(ΦωΦ)

% sudo npm install -g purescript pulp bower

npm WARN deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
/usr/bin/bower -> /usr/lib/node_modules/bower/bin/bower
/usr/bin/pulp -> /usr/lib/node_modules/pulp/index.js
/usr/bin/purs -> /usr/lib/node_modules/purescript/purs.bin

> purescript@0.11.7 postinstall /usr/lib/node_modules/purescript
> install-purescript --purs-ver=0.11.7 --name=purs.bin .

✔ Check if a prebuilt 0.11.7 binary is provided for Linux (2s)
✖ Download the prebuilt PureScript binary
https://github-production-release-asset-2e65be.s3.amazonaws.com/13206906/ffcbf268-c96c-11e7-8176-9099cd51d579?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2
Error: EACCES: permission denied, open 'purs.bin'
▬ Verify the prebuilt binary works correctly
▬ Save the downloaded binary to the cache directory

↓ Fallback: building from source

✖ Check if 'stack' command is available
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ 'stack' command is required for building PureScript from source, but it's not found in your PATH. Make sure you have installed Stack and try again. │
│ │
│ → https://docs.haskellstack.org/en/stable/install_and_upgrade/#linux
│ │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
▬ Download the PureScript 0.11.7 source
▬ Ensure the appropriate GHC is installed
▬ Build a binary from source
▬ Save the built binary to the cache directory

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/pulp/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! purescript@0.11.7 postinstall: `install-purescript --purs-ver=0.11.7 --name=purs.bin .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the purescript@0.11.7 postinstall 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! /root/.npm/_logs/2017-12-13T06_42_53_447Z-debug.log

※何かインストールまともにできてないのにゴミみたいな

 モジュールが大量にインストールされてて「は?」ってなった。

 npmのせいなのかpurescript自身のせいなのか詳しく見てないので

 知らんけどw

 npmではインストール出来ないんだっけ?それともNode.jsのバージョン

 に依存していたりするのだろうか?

 それともCentOSが大変残念な環境なんだろうか?

 いろいろ香ばしいw

[参考サイト]

stackoverflow.com

www.npmjs.com

Package - install-purescript

stackoverflow.com

maku77.github.io