LoginSignup
7
6

More than 5 years have passed since last update.

Centos7にNodejs、express、compassをインストールする

Last updated at Posted at 2015-05-06

Centos7.0にexpressをインストールしようとして少しはまったのでメモ。

NodeJSのインストール

Console
$ sudo yum install epel-release
$ sudo yum install nodejs npm

express-generatorのインストール

Console
$ sudo npm install -g express-generator

express.jsのひな形を作ります。

Console
$ express -c compass testweb

実行

Console
$ cd testweb
$ npm install
$ npm start

ブラウザからアクセスしてみると以下のようなエラーが出て止まってしまった。

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1011:11)
    at Process.ChildProcess._handle.onexit (child_process.js:802:34)
npm ERR! weird error 8
npm ERR! not ok code 0

Rubyのcompassがインストールされていないといけないそうなので以下のようにインストールした。

Console
$ sudo yum install ruby-devel
$ sudo gem update --system
$ sudo gem install compass

再度実行

Console
$ npm start

これでうまく動いた。

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6