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

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

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

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

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

gulp

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

Q&A

解決済

2回答

2274閲覧

MacでのGulpインストール

wakasat

総合スコア11

npm

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

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

gulp

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

0グッド

0クリップ

投稿2018/09/26 17:59

編集2018/10/16 17:11

前提・実現したいこと

WordPressのUnderstrapというテーマを
Gulpでカスタマイズしたいと考えています。

参考にしたもの↓

バージョンなど

  • node v8.12.0
  • npm 6.4.1

実行結果

nodeはここからインストールしました。

$ npm install --grobal gulp-cli + gulp-cli@2.0.1 updated 1 package and audited 17856 packages in 7.871s found 12 vulnerabilities (2 low, 6 moderate, 4 high) run `npm audit fix` to fix them, or `npm audit` for details $ npm install -g browser-sync /Users/mymac/.npm-global/bin/browser-sync -> /Users/mymac/.npm-global/lib/node_modules/browser-sync/dist/bin.js + browser-sync@2.24.7 updated 1 package in 7.914s $ cd /Applications/MAMP/htdocs/test/wp-content/themes/understrap $ npm install > understrap@0.8.7 postinstall /Applications/MAMP/htdocs/test/wp-content/themes/understrap > gulp copy-assets [02:51:42] Using gulpfile /Applications/MAMP/htdocs/test/wp-content/themes/understrap/gulpfile.js [02:51:42] Starting 'copy-assets'... [02:51:42] Finished 'copy-assets' after 8.88 ms audited 17856 packages in 9.504s found 12 vulnerabilities (2 low, 6 moderate, 4 high) run `npm audit fix` to fix them, or `npm audit` for details $ gulp copy-assets -bash: gulp: command not found

試したこと

npm audit fixと出たので調べてみたところ、
脆弱性チェックでエラーが発生したということでしたので上記記事を参考に直しました。
ですが未だに

updated 1 package, moved 1 package and audited 23291 packages in 8.938s found 6 moderate severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details

と表示されます。
権限周りのエラーも出たので、権限を与えましたがエラーが出ます。

$ sudo npm audit fix up to date in 5.363s fixed 0 of 6 vulnerabilities in 23291 scanned packages 6 vulnerabilities required manual review and could not be updated MacBook-Pro:understrap $ sudo npm install npm WARN lifecycle understrap@0.8.7~postinstall: cannot run in wd understrap@0.8.7 gulp copy-assets (wd=/Applications/MAMP/htdocs/test/wp-content/themes/understrap) audited 23291 packages in 7.078s found 6 moderate severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details MacBook-Pro:understrap $

何をすれば良いのかもお手上げです…

すみません、どうかご教授頂けないでしょうか
よろしくお願いいたします。

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

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

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

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

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

guest

回答2

0

自己解決

どうも手順がおかしいのではなく大元でも同じようなエラーが出ているようです。

https://github.com/understrap/understrap/issues/624

正直なところ手に負えないので
公式の動向を見つつ別のアプローチ方法を考えてみます。

ご回答いただきありがとうございました。


※追記

こちらを参考にしました。
パスを通し、パーミッションを編集できるよう変更し、エラーが出てもゴリ押ししたら何とか出来ました。

なんとか行けるまで
Gulp4にしてみたり
npm audit fixが出まくったり
minimatchというツールが危ないとかいろいろ出たのですが
それで解決方法を検索していろいろしてみたのですが
どれもうまく行かなかったです。
おそらくきちんと解決する方法があるのでしょうが、
最初に行いたかったGulpが出来たのでちょっと見ないことにします。

投稿2018/10/18 01:34

編集2018/10/18 13:53
wakasat

総合スコア11

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

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

0

run npm audit fix to fix them, or npm audit for details

と言われていますが、 実行してみましたか?

投稿2018/09/26 23:04

CHERRY

総合スコア25171

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

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

wakasat

2018/09/27 14:55

御返事ありがとうございます。 すみません見過ごしていました… `npm audit fix`を実行してみたところ ``` up to date in 5.283s fixed 0 of 12 vulnerabilities in 17856 scanned packages 7 vulnerabilities required manual review and could not be updated 1 package update for 5 vulns involved breaking changes (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually) ``` と表示されました。 `npm audit fix --force`を実行してみたところ ``` npm WARN using --force I sure hope you know what you are doing. npm WARN checkPermissions Missing write access to /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp npm WARN checkPermissions Missing write access to /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules npm WARN rm not removing /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/.bin/gulp as it wasn't installed by /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp npm ERR! path /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules/.bin npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall rmdir npm ERR! Error: EACCES: permission denied, rmdir '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules/.bin' npm ERR! { Error: EACCES: permission denied, rmdir '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules/.bin' npm ERR! cause: npm ERR! { Error: EACCES: permission denied, rmdir '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules/.bin' npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'rmdir', npm ERR! path: '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules/.bin' }, npm ERR! stack: 'Error: EACCES: permission denied, rmdir \'/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules/.bin\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'rmdir', npm ERR! path: '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules/.bin', npm ERR! parent: 'gulp' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! /Users/mymac/.npm/_logs/2018-09-27T14_11_55_364Z-debug.log ``` と表示されました。 ``` $ npm audit === npm audit security report === # Run npm install gulp@4.0.0 to resolve 5 vulnerabilities SEMVER WARNING: Recommended action is a potentially breaking change │ High│ Regular Expression Denial of Service│ │ Package │ minimatch │ │Dependency of│ gulp│ │ Path│ gulp > vinyl-fs > glob-stream > glob > minimatch│ │ More info │ https://nodesecurity.io/advisories/118│ │ High │ Regular Expression Denial of Service │ │ Package │ minimatch│ │ Dependency of │ gulp │ │ Path│ gulp > vinyl-fs > glob-stream > minimatch │ │ More info │ https://nodesecurity.io/advisories/118 │ │ High │ Regular Expression Denial of Service│ │ Package │ minimatch │ │ Dependency of │ gulp│ │ Path │ gulp > vinyl-fs > glob-watcher > gaze > globule > glob > │ │ │ minimatch│ │ More info │ https://nodesecurity.io/advisories/118│ │ High │ Regular Expression Denial of Service │ │ Package │ minimatch │ │ Dependency of │ gulp │ │ Path │ gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch │ │ More info │ https://nodesecurity.io/advisories/118 │ │ Low │ Prototype Pollution │ │ Package │ lodash │ │ Dependency of │ gulp │ │ Path │ gulp > vinyl-fs > glob-watcher > gaze > globule > lodash │ │ More info │ https://nodesecurity.io/advisories/577 │ │Manual Review │ │Some vulnerabilities require your attention to resolve │ │Visit https://go.npm.me/audit-guide for additional guidance│ │ Moderate │ Memory Exposure │ │ Package │ tunnel-agent│ │ Patched in │ >=0.6.0│ │ Dependency of │ gulp-imagemin │ │ Path │ gulp-imagemin > imagemin-gifsicle > gifsicle > bin-build > │ │ │ download > caw > tunnel-agent│ │ More info│ https://nodesecurity.io/advisories/598 │ │ Moderate │ Memory Exposure │ │ Package │ tunnel-agent│ │ Patched in │ >=0.6.0│ │ Dependency of │ gulp-imagemin│ │ Path │ gulp-imagemin > imagemin-gifsicle > gifsicle > bin-wrapper > │ │ │ download > caw > tunnel-agent│ │ More info │ https://nodesecurity.io/advisories/598│ │ Moderate │ Memory Exposure│ │ Package │ tunnel-agent │ │ Patched in │ >=0.6.0 │ │ Dependency of │ gulp-imagemin│ │ Path│ gulp-imagemin > imagemin-jpegtran > jpegtran-bin > bin-build │ │ │ > download > caw > tunnel-agent│ │ More info│ https://nodesecurity.io/advisories/598│ │ Moderate│ Memory Exposure│ │ Package│ tunnel-agent │ │ Patched in│ >=0.6.0│ │ Dependency of │ gulp-imagemin│ │ Path│ gulp-imagemin > imagemin-jpegtran > jpegtran-bin >│ │ │ bin-wrapper > download > caw > tunnel-agent│ │ More info│ https://nodesecurity.io/advisories/598│ │ Moderate│ Memory Exposure│ │ Package│ tunnel-agent│ │ Patched in │ >=0.6.0 │ │ Dependency of │ gulp-imagemin│ │ Path│ gulp-imagemin > imagemin-optipng > optipng-bin > bin-build >│ │ │ download > caw > tunnel-agent│ │ More info│ https://nodesecurity.io/advisories/598│ │ Moderate│ Memory Exposure│ │ Package│ tunnel-agent │ │ Patched in │ >=0.6.0│ │ Dependency of │ gulp-imagemin│ │ Path │ gulp-imagemin > imagemin-optipng > optipng-bin > bin-wrapper │ │ │ > download > caw > tunnel-agent│ │ More info│ https://nodesecurity.io/advisories/598│ │ Low│ Regular Expression Denial of Service │ │ Package│ debug│ │ Patched in │ >= 2.6.9 < 3.0.0 || >= 3.1.0 │ │ Dependency of │ browser-sync│ │ Path│ browser-sync > localtunnel > debug│ │ More info │ https://nodesecurity.io/advisories/534│ found 12 vulnerabilities (2 low, 6 moderate, 4 high) in 17856 scanned packages 5 vulnerabilities require semver-major dependency updates. 7 vulnerabilities require manual review. See the full report for details. ``` ``` $ npm install gulp@4.0.0 npm WARN checkPermissions Missing write access to /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp npm WARN checkPermissions Missing write access to /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp/node_modules npm ERR! path /Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp' npm ERR! { Error: EACCES: permission denied, access '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp' npm ERR! stack: 'Error: EACCES: permission denied, access \'/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/Applications/MAMP/htdocs/test/wp-content/themes/understrap/node_modules/gulp' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! /Users/mymac/.npm/_logs/2018-09-27T14_21_22_606Z-debug.log ``` アクセス権がないということだと思うのですが… すみません何だか手に負えない感じになってきているような… これからどうしたら良いかご教授頂けないでしょうか。 頼りっきりになってしまい大変申し訳ありません。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問