質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Q&A

1回答

7671閲覧

npm で node-sass のインストール失敗してしまう

y214

総合スコア33

npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

0グッド

0クリップ

投稿2017/03/19 02:11

質問

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

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

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 ~]#

投稿2017/03/19 08:16

mosapride

総合スコア1480

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問