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

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

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

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

Node.js

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

gulp

gulpは、Node.jsをベースとしたタスク自動化ツールの一つ。ストリームでファイルを処理することが特徴です。CSSプリプロセッサの使用時のコンパイルや、CSS・JavaScriptファイルの圧縮・結合などを自動的に行うことができます。

Q&A

解決済

1回答

5070閲覧

gulp-sassがインストールできない

Jampui

総合スコア16

npm

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

Node.js

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

gulp

gulpは、Node.jsをベースとしたタスク自動化ツールの一つ。ストリームでファイルを処理することが特徴です。CSSプリプロセッサの使用時のコンパイルや、CSS・JavaScriptファイルの圧縮・結合などを自動的に行うことができます。

0グッド

0クリップ

投稿2017/10/07 15:15

初めまして。お世話になります。

実現したいこと・前提

当方はgulpで開発環境を作ろうとしたのですが、表題のとおり、sudo npm i -D gulp-sassをいくら打っても、gulp-sassだけインストールできません(ほかのパッケージはインストールできました)。
原因がわからず、まだNode.jsやnpmにも疎いもので、エラー文をよんでもよくわかりません。エラー文は長文で、すみませんが、手助けいただければ幸いです。

ちなみに、

  • Node.jsのバージョンは v6.11.2
  • npmのバージョンは 5.5.1
  • gulpのバージョンは CLI version 1.4.0 Local version 3.9.1

です。

エラー文

> node-sass@4.5.3 install /Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass
> node scripts/install.js

Unable to save binary /Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass/vendor/darwin-x64-48 : { Error: EACCES: permission denied, mkdir '/Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass/vendor'
at Error (native)
at Object.fs.mkdirSync (fs.js:923:18)
at sync (/Users/jampuiyamada/Sites/new_gulp/node_modules/mkdirp/index.js:71:13)
at Function.sync (/Users/jampuiyamada/Sites/new_gulp/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass/scripts/install.js:111:11)
at Object.<anonymous> (/Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass/scripts/install.js:154:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass/vendor' }

> node-sass@4.5.3 postinstall /Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /Users/jampuiyamada/Sites/new_gulp/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/Users/jampuiyamada/Sites/new_gulp/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@6.11.2 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:89:16
gyp verb which failed at /Users/jampuiyamada/Sites/new_gulp/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/jampuiyamada/Sites/new_gulp/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb which failed python2 { Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:89:16
gyp verb which failed at /Users/jampuiyamada/Sites/new_gulp/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/jampuiyamada/Sites/new_gulp/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb which failed stack: 'Error: not found: python2\n at getNotFoundError (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:13:12)\n at F (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:68:19)\n at E (/Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:80:29)\n at /Users/jampuiyamada/Sites/new_gulp/node_modules/which/which.js:89:16\n at /Users/jampuiyamada/Sites/new_gulp/node_modules/isexe/index.js:42:5\n at /Users/jampuiyamada/Sites/new_gulp/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:123:15)',
gyp verb which failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb which succeeded python /usr/bin/python
gyp verb check python version /usr/bin/python -c "import platform; print(platform.python_version());" returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.11.2
gyp verb command install [ '6.11.2' ]
gyp verb install input version string "6.11.2"
gyp verb install installing version: 6.11.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 6.11.2
gyp verb build dir attempting to create "build" dir: /Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass/build'
gyp ERR! stack at Error (native)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/jampuiyamada/Sites/new_gulp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/jampuiyamada/Sites/new_gulp/node_modules/node-sass
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN new_gulp@1.0.0 No description
npm WARN new_gulp@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 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! /Users/jampuiyamada/.npm/_logs/2017-10-07T14_56_08_730Z-debug.log

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

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

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

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

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

guest

回答1

0

自己解決

いろいろ試してみたところ、nvmでnode.jsのバージョンを最新にしたところ解決できました。失礼しました。

投稿2017/10/07 16:01

Jampui

総合スコア16

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問