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

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

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

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

Q&A

解決済

2回答

805閲覧

npm installでエラーになる。(sass,gulp環境構築できない)

kozzy841

総合スコア7

npm

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

0グッド

0クリップ

投稿2018/01/12 15:51

gulp,sassを学習しようと「html/cssデザイン講義」というテキストの環境構築で(pcはwindows10)
テキストどおりnode.jsをインストール、gulpをインストール後、用意されているファイルから
コマンドプロンプトで指示通り、npm installで環境設定ができるはずが以下のエラーでうまくいきません。
(node_moduleファイル自体はできています。)少し調べてnpmそのもののバージョンアップ、npmのキャッシュを削除のコマンド後にためしましたが同じでした。うまくいけばgulpコマンドでブラウザーまで立ち上がるように準備されているようです。以下のエラーの対処方法教えていただけたらお願いいたします。

###発生している問題・エラーメッセージ
ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:483:19)gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Users\HP\Desktop\site\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HP\Desktop\site\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\HP\Desktop\site\node_modules\node-sass
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN src@1.0.0 No description
npm WARN src@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 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! C:\Users\HP\AppData\Roaming\npm-cache_logs\2018-01-12T15_24_42_671Z-debug.logERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:483:19)gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Users\HP\Desktop\site\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HP\Desktop\site\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\HP\Desktop\site\node_modules\node-sass
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN src@1.0.0 No description
npm WARN src@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 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! C:\Users\HP\AppData\Roaming\npm-cache_logs\2018-01-12T15_24_42_671Z-debug.logERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:483:19)gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Users\HP\Desktop\site\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HP\Desktop\site\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\HP\Desktop\site\node_modules\node-sass
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN src@1.0.0 No description
npm WARN src@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 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! C:\Users\HP\AppData\Roaming\npm-cache_logs\2018-01-12T15_24_42_671Z-debug.log

###該当のソースコード

ここにご自身が実行したソースコードを書いてください

###試したこと
課題に対してアプローチしたことを記載してください

###補足情報(言語/FW/ツール等のバージョンなど)
より詳細な情報

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

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

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

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

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

guest

回答2

0

自己解決

phythonは最新の3ではなく2をインストールする必要があるようです。でやってみましたが今度はvisualstudio~がないという別のエラーがでました。
トライしましたがうまくいきませんでした。
こちらのサイトhttps://gist.github.com/kamiyam/b153a30e9c3684c1093b51432d1d7709など参考に解決される方もいるかとは思います。

結局、npm install -D gulp-sassなどで個別にはインストールはできるので、
gulpfile.jsとはなにかを調べて(コピーして)、新しくつくり何とかコンパイルできる環境になりました。

投稿2018/01/25 06:52

kozzy841

総合スコア7

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

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

0

pythonをインストールしてPATHを通して下さい。

投稿2018/01/12 20:45

hichon

総合スコア5737

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

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

kozzy841

2018/01/13 03:43

ご指摘ありがとうございます。pythonインストール、環境変数でパスチェック後、試してみましたが同じようなエラーでした。念のため再起動後、試しましたが同じでした。 以下エラー画面です。 gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "C:\Users\HP\AppData\Local\Programs\Python\Python37\python.EXE", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:483:19)gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\HP\Desktop\site\node_modules\node-gyp\lib\configure.js:508:16) gyp ERR! stack at C:\Users\HP\Desktop\site\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HP\Desktop\site\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd C:\Users\HP\Desktop\site\node_modules\node-sass gyp ERR! node -v v8.9.4 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm WARN src@1.0.0 No description npm WARN src@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@3.13.1 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! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2018-01-13T03_39_43_807Z-debug.log C:\Users\HP\Desktop\site>python --version Python 3.7.0a4 C:\Users\HP\Desktop\site>
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問