###LaravelでOAuth2のサーバー組み込みをし、Laravel/PassportのクイックスタートのVue.jsのページを表示したい
PHP(Laravel5.4)でOAuth2のサーバー組み込みを実装しようとしています。
2017年11月4日時点での最新Laravel5.5を使わない理由は特にありません。
ただ、安定版(LTS)を使用したいと思い、5.4を選択しているだけです。
しかし、Laravel/PassportのVue.jsのクイックスタートがうまく表示されません。
Laravelのインストールは、create-projectコマンドで、バージョン指定し、5.4を選択しました。
create-projectコマンド直後は、nodeのバージョンも5.0.0で、webpackやlaravel-mix、cross-env
のエラーがたくさんあったので、難航しています。ここで、2週間ほどハマっていますので質問させて頂きました。僕の今の考えは、Laravel5.5にしたら、案外簡単に、解決するのかもしれない?と思っています。
・Laravel/Passport 5.4公式Readouble
https://readouble.com/laravel/5.4/ja/passport.html
・参考ブログ
http://www.dn-web64.com/archives/web/laravel_passport/
※npm run devを実行中に以下のエラーメッセージが出ました。まずは、npm run devで再コンパイルが通るようにしたいと思っています。よろしくお願い致します。
###発生している問題・エラーメッセージ
・npm install実行時
npm install npm WARN deprecated express@2.5.11: express 2.x series is deprecated npm WARN deprecated connect@1.9.2: connect 1.x series is deprecated npm WARN prefer global marked@0.3.6 should be installed with -g npm WARN prefer global node-gyp@3.6.2 should be installed with -g > node-sass@4.5.3 install /var/www/public/passport/node_modules/node-sass > node scripts/install.js Cached binary found at /home/vagrant/.npm/node-sass/4.5.3/linux-x64-51_binding.node > node-sass@4.5.3 postinstall /var/www/public/passport/node_modules/node-sass > node scripts/build.js Binary found at /var/www/public/passport/node_modules/node-sass/vendor/linux-x64-51/binding.node Testing binary Binary is fine > gifsicle@3.0.4 postinstall /var/www/public/passport/node_modules/gifsicle > node lib/install.js ⚠ Couldn't execute the `/var/www/public/passport/node_modules/gifsicle/vendor/gifsicle` binary. Make sure it has the right permissions. ⚠ gifsicle pre-build test failed ℹ compiling from source ✔ gifsicle built successfully > mozjpeg@4.1.1 postinstall /var/www/public/passport/node_modules/mozjpeg > node lib/install.js ⚠ Couldn't execute the `/var/www/public/passport/node_modules/mozjpeg/vendor/cjpeg` binary. Make sure it has the right permissions. ⚠ mozjpeg pre-build test failed ℹ compiling from source ✖ Error: autoreconf -fiv && ./configure --disable-shared --prefix="/var/www/public/passport/node_modules/mozjpeg/vendor" --bindir="/var/www/public/passport/node_modules/mozjpeg/vendor" --libdir="/var/www/public/passport/node_modules/mozjpeg/vendor" && make --jobs=2 && make install --jobs=2 Command failed: autoreconf -fiv autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/bin/autoconf --force configure.ac:22: error: possibly undefined macro: AC_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf: /usr/bin/autoconf failed with exit status: 1 at ChildProcess.exithandler (child_process.js:205:12) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:194:7) at maybeClose (internal/child_process.js:899:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) > optipng-bin@3.1.4 postinstall /var/www/public/passport/node_modules/optipng-bin > node lib/install.js ⚠ Couldn't execute the `/var/www/public/passport/node_modules/optipng-bin/vendor/optipng` binary. Make sure it has the right permissions. ⚠ optipng pre-build test failed ℹ compiling from source ✔ optipng built successfully > pngquant-bin@3.1.1 postinstall /var/www/public/passport/node_modules/pngquant-bin > node lib/install.js ⚠ Couldn't execute the `/var/www/public/passport/node_modules/pngquant-bin/vendor/pngquant` binary. Make sure it has the right permissions. ⚠ pngquant pre-build test failed ℹ compiling from source ✖ Error: pngquant failed to build, make sure that libpng-dev is installed at ChildProcess.exithandler (child_process.js:205:12) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:194:7) at maybeClose (internal/child_process.js:899:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
・npm run dev実行時
npm run dev > @ dev /var/www/public/passport > npm run development > @ development /var/www/public/passport > node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js sh: 1: node_modules/cross-env/dist/bin/cross-env.js: Permission denied npm ERR! Linux 3.13.0-55-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "development" npm ERR! node v7.10.1 npm ERR! npm v4.2.0 npm ERR! code ELIFECYCLE npm ERR! errno 126 npm ERR! @ development: `node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` npm ERR! Exit status 126 npm ERR! npm ERR! Failed at the @ development script 'node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.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 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/vagrant/.npm/_logs/2017-11-01T06_56_25_353Z-debug.log npm ERR! Linux 3.13.0-55-generic npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev" npm ERR! node v7.10.1 npm ERR! npm v4.2.0 npm ERR! code ELIFECYCLE npm ERR! errno 126 npm ERR! @ dev: `npm run development` npm ERR! Exit status 126 npm ERR! npm ERR! Failed at the @ dev script 'npm run development'. 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 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run development npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/vagrant/.npm/_logs/2017-11-01T06_56_25_378Z-debug.log
###該当のソースコード(package.json)
{ "private": true, "scripts": { "dev": "npm run development", "development": "node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch-poll": "npm run watch -- --watch-poll", "hot": "node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.16.2", "bootstrap-sass": "^3.3.7", "cross-env": "^5.1.1", "jquery": "^3.1.1", "laravel-mix": "^0.11.4", "lodash": "^4.17.4", "vue": "^2.1.10", "vue-loader": "^13.0.5" }, "dependencies": { "webpack": "^2.0.0" } }
###試したこと
cross-envのパスが通っていれば、ほぼ問題なく通るという記事をよく見かけます。
しかし、それだけではうまくいかず、npm install の段階で上記エラーが出ます。
1.npm installのautoreconfエラーに対しては、ubuntu の scotchboxを使っているので
$sudo apt-get install autoconf
2.fsevent.jsのnodeのエラーに対しては、node バージョン 7.10.1が解決すると聞いたので
$sudo n 7.10.1
で解決しました。現在では、1、2のエラーは解消されております。
vue.jsのOAuth2起動画面が出ないところで、2週間以上ハマっています。
###補足情報(言語/FW/ツール等のバージョンなど)
Laravel 5.4
node 7.10.1
npm 4.2.0
webpack 2.0.0
laravel-mix ^0.11.4
OS:Mac OS Sierra 10.12.6
vagrant 1.8.6
virtualbox 5.0.28
scotchbox 3.0
を使用しています。
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/11/05 00:01