npm で node-sass のインストール失敗してしまう
受付中
回答 1
投稿
- 評価
- クリップ 0
- VIEW 6,086
質問
vagrant 上で
$ npm install node-sass
とすると、
> node-sass@4.5.0 install /var/www/html/node_modules/node-sass
> node scripts/install.js
sh: node: コマンドが見つかりません
・・(略)・・
npm ERR! argv "/root/.nodebrew/node/v6.10.0/bin/node" "/root/.nodebrew/current/bin/npm" "install" "node-sass"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! node-sass@4.5.0 install: `node scripts/install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the node-sass@4.5.0 install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
・・(略)・・
というエラーが出てインストールできません。
どなたか解決方法をご教授ください。
環境
$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
$ node -p process.versions
{ http_parser: '2.7.0',
node: '6.10.0',
v8: '5.1.281.93',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '58.2',
modules: '48',
openssl: '1.0.2k' }
$ which node
/root/.nodebrew/current/bin/node
$ which npm
/root/.nodebrew/current/bin/npm
$ cat ~/.bashrc
# .bashrc
・・(略)・・
export PATH=$HOME/.nodebrew/current/bin:$PATH
よろしくおねがいしますm(_ _)m
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
0
docker/centosで動かしたら問題なくインストールできました。
node-sassのバージョンも同じです。
実行ユーザーはroot
エラーで気になるところはenoentが出てるところですかね。
http://itref.fc2web.com/unix/system_call.html#enoent
No such file or directory
ファイルまたはディレクトリが存在しません。
npmコマンドを実行したユーザーがディレクトリ・またはファイルの作成権限などをもっていなくてエラーになってたりませんかね。
一応実行したログを残しておきます。
[root@6e626b94b567 ~]# history
1 curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
2 yum install -y gcc-c++ make
3 yum install -y nodejs
不要なところだったから削除
9 cd ~
10 npm init
12 npm install node-sass
13 history
[root@6e626b94b567 ~]# npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
name: (root)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /root/package.json:
{
"name": "root",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this ok? (yes)
[root@6e626b94b567 ~]# npm install node-sass
npm WARN prefer global node-gyp@3.6.0 should be installed with -g
> node-sass@4.5.0 install /root/node_modules/node-sass
> node scripts/install.js
Cached binary found at /root/.npm/node-sass/4.5.0/linux-x64-48_binding.node
> node-sass@4.5.0 postinstall /root/node_modules/node-sass
> node scripts/build.js
Binary found at /root/node_modules/node-sass/vendor/linux-x64-48/binding.node
Testing binary
Binary is fine
root@1.0.0 /root
`-- node-sass@4.5.0
+-- async-foreach@0.1.3
+-- chalk@1.1.3
| +-- ansi-styles@2.2.1
~~~~~~~~~~~~~~~~~~~~~長いので略
| +-- os-locale@1.4.0
| | `-- lcid@1.0.0
| | `-- invert-kv@1.0.0
| +-- require-directory@2.1.1
| +-- require-main-filename@1.0.1
| +-- which-module@1.0.0
| +-- window-size@0.2.0
| +-- y18n@3.2.1
| `-- yargs-parser@2.4.1
| `-- camelcase@3.0.0
`-- stdout-stream@1.4.0
`-- readable-stream@2.2.6
+-- buffer-shims@1.0.0
+-- core-util-is@1.0.2
+-- isarray@1.0.0
+-- process-nextick-args@1.0.7
+-- string_decoder@0.10.31
`-- util-deprecate@1.0.2
npm WARN root@1.0.0 No description
npm WARN root@1.0.0 No repository field.
[root@6e626b94b567 ~]#
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.10%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる