Help us understand the problem. What is going on with this article?

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

More than 5 years have passed since last update.

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

これでうまく動いた。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした