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

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

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

Sassは、プログラミング風のコードでCSSを生成できるスタイルシート言語です。 scss ファイルを、変換(コンパイル)してCSSファイルを作成します。

gulp

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

Q&A

1回答

1678閲覧

人が作ったgulp環境を自分のローカルで動かしたい

Tatsurou

総合スコア81

Sass

Sassは、プログラミング風のコードでCSSを生成できるスタイルシート言語です。 scss ファイルを、変換(コンパイル)してCSSファイルを作成します。

gulp

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

0グッド

0クリップ

投稿2018/03/30 10:33

編集2018/04/26 03:30

##やりたいこと
人が作ったgulp環境を自分のローカルで動かしたい

知人にgulp環境一式を渡されたのですが、
まず何をすべきかわかりません。

一から構築はしたことがあるのですが、
人の環境をもらって、その環境を動かす時の手順を教えていただけないでしょうか。

頂いたファイル

イメージ説明

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

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

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

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

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

guest

回答1

0

前準備

Bash

1# Node.jsが必要なので入っているか確認 2$ node -v 3 4# Node.js用のパッケージ管理ツールも必須なので確認 5$ npm -v 6 7# package.jsonがあるフォルダまで移動 8$ cd project-root 9 10# 依存ライブラリを導入 (package.jsonのdependenciesを参照) 11$ npm install 12 13# 開発者用依存ライブラリも導入 (package.jsonのdevDependenciesを参照) 14$ npm install -D 15 16# Gulpの実行コマンドも確認しましょ 17$ gulp -v 18 19# 【Gulpコマンドが無くて怒られた場合】 20$ npm install -g gulp 21 22# Gulpのタスク一覧を確認 23$ gulp --tasks

此処まで全部実行すれば使えるはずです。

投稿2018/03/30 13:24

編集2018/03/30 13:25
miyabi-sun

総合スコア21158

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

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

Tatsurou

2018/04/26 03:28

多忙につき、返信が遅くなり申し訳ありません。 ご教授いただいた通り、node -v してみたのですが、 ``````` zsh: command not found: node ``````` といったエラーが出てしまいました。 調べたのですが、あまりしっくりくる記事がなく、困っています。
Tatsurou

2018/04/26 07:19

node js をインストールしてから、 npm install したのですが、 最後の方で、以下のようなエラーが出てしまいました。 ````` ../../nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object' return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs); ~~~ ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:834:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:849:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:864:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:1473:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return scope.Escape(node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ 4 warnings and 1 error generated. make: *** [Release/obj.target/binding/src/binding.o] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/xxxxxxxx/XXX/1111111111_aaaaaaaaaa/node_modules/node-gyp/lib/build.js:258:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12) gyp ERR! System Darwin 16.1.0 gyp ERR! command "/usr/local/bin/node" "/Users/xxxxxxxx/XXX/1111111111_aaaaaaaaaa/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /Users/xxxxxxxx/XXX/1111111111_aaaaaaaaaa/node_modules/node-sass gyp ERR! node -v v10.0.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm WARN gulp_test@1.0.0 No description npm WARN gulp_test@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/xxxxxxxx/.npm/_logs/2018-04-26T07_11_33_345Z-debug.log `````
miyabi-sun

2018/04/26 07:47

node-gypって言ってるからそのパッケージが動く環境頑張って作って 「node-gyp インストール」とかOS名を追加するとかしながら頑張って
Tatsurou

2018/04/26 08:02

ちなみにwindowsで作られた環境だそうで、私のPCはMacです。そこも問題でしょうか? OS名を追加という部分がいまいちわかりませんでした。
miyabi-sun

2018/04/26 08:21

node-gypというのは、CやC++のアプリを指しています。 CやC++のアプリはOSによって実行ファイルが異なるので、ソースコードで配布して使う文化なんですよ。 なのでCやC++をコンパイルする環境が必要です。 MacならデフォルトでCやC++をコンパイルする事が出来ませんので、 App Storeを開いてXcodeをインストールする所から初めて下さい。 続きの処理はMacの場合は「node-gyp インストール Mac」などとして検索してみてください。 これでインストール出来るんじゃないかなと思います。
Tatsurou

2018/04/26 08:22

ありがとうございます!勉強になります。試してみます。
Tatsurou

2018/04/26 09:45

x-codeが、最新のOS(10.13)を要求してきたので、時間ができたときにインストールします。
miyabi-sun

2018/04/26 09:46

ありゃあ、確かにあやつは最新のOSを要求するんですよね… 了解です。がんばって下さい
Tatsurou

2018/04/27 09:07

> 続きの処理はMacの場合は「node-gyp インストール Mac」などとして検索してみてください。 > これでインストール出来るんじゃないかなと思います。 Xcodeをインストールしましたが、 node-gypの記事が見つからずどうしていいかわかりません、、
miyabi-sun

2018/04/27 09:33

Macの場合はPythonは初期で入ってますよね ん〜と、MacはXcodeさえ入っていれば意外とすんなり行けた気がしますね。 プロジェクトルートまで移動してnpm installから試してみてください
Tatsurou

2018/04/27 09:48

Xcodeだけでなく、Xcode コマンド ライン ツールをインストール(sudo xcode-select --install)したら、いけました!
Tatsurou

2018/04/27 09:49

あ、ダメでした、、
Tatsurou

2018/04/27 09:55

最後に、以下のようなエラーが出ます。 In file included from ../../nan/nan.h:192: ../../nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object' return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs); ~~~ ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:834:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:849:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:164:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:864:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:157:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ In file included from ../src/binding.cpp:1: ../../nan/nan.h:1473:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] return scope.Escape(node::MakeCallback( ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:171:1: note: 'MakeCallback' has been explicitly marked deprecated here NODE_DEPRECATED("Use MakeCallback(..., async_context)", ^ /Users/xxxxxxxx/.node-gyp/10.0.0/include/node/node.h:88:20: note: expanded from macro 'NODE_DEPRECATED' __attribute__((deprecated(message))) declarator ^ 4 warnings and 1 error generated. make: *** [Release/obj.target/binding/src/binding.o] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/xxxxxxxxxxxxxxxxx/node_modules/node-gyp/lib/build.js:258:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12) gyp ERR! System Darwin 17.5.0 gyp ERR! command "/usr/local/bin/node" "/Users/xxxxxxxxxxxxxxxxx/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /Users/xxxxxxxxxxxxxxxxx/node_modules/node-sass gyp ERR! node -v v10.0.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm WARN gulp_test@1.0.0 No description npm WARN gulp_test@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/xxxxxxxx/.npm/_logs/2018-04-27T09_48_23_463Z-debug.log
miyabi-sun

2018/04/27 09:59

$ python --version これを入力してもらってもいいですか? たしか3系ならアウトです。
Tatsurou

2018/05/07 07:27

返信遅くなりました、、 Python 2.7.10でした。。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.47%

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

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

質問する

関連した質問