Laravel Mix -> Hackers Galore 様編

Posted by muchag | CakePHP 3.x,Library & PlugIn & AddIn,困ったTT | 2018-12-07 (金) 13:31:02

【環境】
CakePHP: 3.6.5
php: 7.3.0 rc6
手順
シンボリックリンク問題対応

シンボリックリンク権限問題 解決のために
シンボリックリンクを作成。


mkdir /media/sf_CakeTest/node_modules
mkdir /var/CakeTest
mkdir /var/CakeTest/node_modules
mount --bind /var/CakeTest/node_modules /media/sf_CakeTest/node_modules
package.json 配置

https://github.com/laravel/laravel/blob/master/package.json
を CakePHP3 のルートディレクトリへ配置。

webroot 内に配置しないように。

私は、直接 Laravel 5.7.15 からコピペした。

インストール

cd /media/sf_CakeTest
yarn install
imagemin

imagemin についての警告が出るので、インストール。


warning "laravel-mix > img-loader@3.0.1" has unmet peer dependency "imagemin@^5.0.0 || ^6.0.0".

こちらを解決するために、imagemin をインストール。


yarn add -D imagemin
yarn add v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 14 new dependencies.
info Direct dependencies
└─ imagemin@6.0.0
info All dependencies
├─ @mrmlnc/readdir-enhanced@2.2.1
├─ @nodelib/fs.stat@1.1.3
├─ arrify@1.0.1
├─ call-me-maybe@1.0.1
├─ dir-glob@2.0.0
├─ fast-glob@2.2.4
├─ file-type@8.1.0
├─ glob-to-regexp@0.3.0
├─ globby@8.0.1
├─ ignore@3.3.10
├─ imagemin@6.0.0
├─ merge2@1.2.3
├─ p-pipe@1.2.0
└─ replace-ext@1.0.0
Done in 9.96s.
webpack.mix.js 配置

https://github.com/laravel/laravel/blob/master/webpack.mix.js
を CakePHP3 のルートディレクトリへ配置。

私は、直接 Laravel 5.7.15 からコピペした。

assets ディレクトリ配置
/assets/js/app.js
/assets/sass/app.sass

を配置。

私は、直接 Laravel 5.7.15 からコピペした。

webpack.mix.js 修正

参考サイトのものを基に、自分の環境に合わせて改変。

/webpack.mix.js

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css');


mix.setPublicPath('webroot'); // since not in Laravel, need to help Mix along here
mix.js('assets/js/app.js', 'webroot/js')
.sass('assets/sass/app.scss', '../assets/build/css')
.sass('assets/sass/self.scss', '../assets/build/css')
.styles([
    'assets/build/css/app.css',
    'assets/build/css/self.css'
    ], 'webroot/css/app.css');
テストコード

参考サイトにはテストコードを記述する件があるけど
Laravel からコピペしてきた、ExampleComponent.vue があるので
テストコードはスキップ。

組み込み
/src/Template/Pages/home.ctp

header 閉じタグ直後に3行追加。


body 閉じタグ直前に2行追加。


webpack 始動

npm run watch

 DONE  Compiled successfully in 8082ms                                                                                                                                                                                                                                                                               15:57:56
                                                                                                                                                                                                                                                                                                                       Asset     Size  Chunks                    Chunk Names
  /js/app.js  1.38 MB       0  [emitted]  [big]  /js/app
/css/app.css   198 kB       0  [emitted]         /js/app
表示確認

CakePHP3 のロゴ黒帯下に

Example Component
I’m an example component.

と、ExampleComponent.vue の内容が表示された。

やた~!!

ところが・・・

その後の使い方で 困ったこと が・・・。

webpack.mix.js において
ファイル統合をしようとすると
表示時にデベロッパーツールのコンソールへ謎のエラー、
というか、
コンパイル後の app.js へ、謎の追記がされる。

stack overflow:Uncaught SyntaxError: Invalid or unexpected token in file compiled by Browserify(2016-06-10)
こちらと同じ症状っぽいんだけど、
上記は Elixir 時代のものだし、提示されている方法が Nginx のもので
私の環境は Apache なので、どうしてよいかわからずじまい。

webpack.mix.js

mix.setPublicPath('webroot'); // since not in Laravel, need to help Mix along here
mix.js('resources/assets/js/app.js', 'webroot/js')
.sass('resources/assets/sass/app.scss', 'webroot/css');

これだと問題ないけど


mix.setPublicPath('webroot'); // since not in Laravel, need to help Mix along here
mix.js('assets/js/app.js', 'webroot/js')
.sass('assets/sass/app.scss', '../assets/build/css')
.sass('assets/sass/self.scss', '../assets/build/css')
.styles([
    'assets/build/css/app.css',
    'assets/build/css/self.css'
    ], 'webroot/css/app.css');

これだと
コンパイルは無事に通り、ファイルも生成されるけど
Uncaught SyntaxError: Invalid or unexpected token となり
デベロッパーツール上では、app.js に ******************************************** な感じのが表示される。
コンパイル後の app.js ファイルを直接見てもそんな記述はないけど。。。

わかる方がいらしたら、ぜひ情報をください。

試行錯誤
yarn install

yarn install --no-bin-links
yarn install v1.12.3
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "laravel-mix > img-loader@3.0.1" has unmet peer dependency "imagemin@^5.0.0 || ^6.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 120.15s.
解決1

warning laravel-mix > autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

こちらの4行を解決するために

/package.json

へ、下記3行を追記。


"browserslist": [
    "> 1%",
    "last 2 versions"
],

と思ったけど、これでは解決しない。

解決2

こちらは、yarn install 前にはできないので
下記警告が出てから対処。


warning "laravel-mix > img-loader@3.0.1" has unmet peer dependency "imagemin@^5.0.0 || ^6.0.0".

こちらを解決するために、imagemin をインストール。


yarn add -D imagemin
npm run watch1

起動してみると


npm run watch

__ snip __

sh: cross-env: コマンドが見つかりません

と怒られた。

解決

teratail:npm run watch時に「sh: 1: cross-env: not found」のエラー発生(2018-04-05)
を参考にして、package.json を、下記の通り編集。

/package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env 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": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
}


{
    "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": "npm run development -- --watch",
        "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 --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
}
npm run watch2

再び、webpack を起動してみると


npm run watch

__ snip __

These dependencies were not found:

* /media/sf_CakeTest/resources/assets/js/app.js in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
* /media/sf_CakeTest/resources/assets/sass/app.scss in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
解決

これは、resources ディレクトリを Laravel からコピペしたため
assets ディレクトリを配置し忘れていた。

npm run watch3

再び、webpack を起動してみると


npm run watch

__ snip __

 error  in ./resources/assets/sass/app.scss

Module build failed: Error: ENOENT: no such file or directory, scandir '/media/sf_CakeTest/node_modules/node-sass/vendor'
npm rebuild node-sass

Qiita:EC2環境でLaravelのセットアップ中にnode-sassのvenderディレクトリが見つからないと言われたときの対処法(2016-07-21)
を参考に npm rebuild node-sass してみた。


npm rebuild node-sass
npm ERR! path ../node-sass/bin/node-sass
npm ERR! code EROFS
npm ERR! errno -30
npm ERR! syscall symlink
npm ERR! rofs EROFS: read-only file system, symlink '../node-sass/bin/node-sass' -> '/media/sf_CakeTest/node_modules/.bin/node-sass'
npm ERR! rofs Often virtualized file systems, or other file systems
npm ERR! rofs that don't support symlinks, give this error.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-12-07T05_28_07_044Z-debug.log
シンボリックリンク権限問題

件の シンボリックリンク権限問題 が出たので


mkdir /var/CakeTest
mkdir /var/CakeTest/node_modules
mount --bind /var/CakeTest/node_modules /media/sf_CakeTest/node_modules
npm rebuild node-sass再

で、もっかい


npm rebuild node-sass

> node-sass@4.10.0 install /media/sf_CakeTest/node_modules/node-sass
> node scripts/install.js

node-sass build Binary found at /media/sf_CakeTest/node_modules/node-sass/vendor/linux-x64-57/binding.node

> node-sass@4.10.0 postinstall /media/sf_CakeTest/node_modules/node-sass
> node scripts/build.js

Binary found at /media/sf_CakeTest/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
node-sass@4.10.0 /media/sf_CakeTest/node_modules/node-sass

それでも vendor ディレクトリは生成されなかった。

npm install node-sass@3.7.0

そこで、
stack overflow:Error: ENOENT: no such file or directory, scandir
に載っていた


npm install node-sass@3.7.0

を実行してみると
大量のログが出たけど
vendor ディレクトリは生成されなかった。

解決?

ここで試しに webpack を起動。


npm run dev

すると、コンパイル完了。

どの時点で、不具合が解消されたか不明。
次回試行まだお預け。

予想

npm rebuild node-sass

こちらで入ってきた node-sass は 4.10.0

そして、3.7.0 を入れたらうまくいったので
4.10.0 の不具合?

参考サイト

Hackers Galore:Using Laravel Mix with CakePHP 3(2018-04-29)

ログ
sh: cross-env: コマンドが見つかりません

npm run watch

> @ watch /media/sf_CakeTest
> npm run development -- --watch


> @ development /media/sf_CakeTest
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"

sh: cross-env: コマンドが見つかりません
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional log

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-12-07T04_27_40_334Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional log

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-12-07T04_27_40_345Z-debug.log
ERROR in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

npm run watch

ERROR  Failed to compile with 2 errors                                                                                                                                                                                                                                                                              14:16:59

These dependencies were not found:

* /media/sf_CakeTest/resources/assets/js/app.js in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
* /media/sf_CakeTest/resources/assets/sass/app.scss in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

To install them, you can run: npm install --save /media/sf_CakeTest/resources/assets/js/app.js /media/sf_CakeTest/resources/assets/sass/app.scss                                                                                                                                                                     Asset     Size  Chunks             Chunk Names
/js/app.js  2.76 kB       0  [emitted]  /js/app

ERROR in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
Module not found: Error: Can't resolve '/media/sf_CakeTest/resources/assets/js/app.js' in '/media/sf_CakeTest'
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

ERROR in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
Module not found: Error: Can't resolve '/media/sf_CakeTest/resources/assets/sass/app.scss' in '/media/sf_CakeTest'
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
Module build failed: Error: ENOENT: no such file or directory, scandir ‘/media/sf_CakeTest/node_modules/node-sass/vendor’

npm run watch

> @ watch /media/sf_CakeTest
> npm run development -- --watch


> @ development /media/sf_CakeTest
> 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"

 10% building modules 1/1 modules 0 active
Webpack is watching the files…
                                                                                                                                                                                                                                                                                    95% emitting                             
 ERROR  Failed to compile with 2 errors                                                                                                                                                                                                                                                                              14:25:46

 error  in ./resources/assets/sass/app.scss

Module build failed: Error: ENOENT: no such file or directory, scandir '/media/sf_CakeTest/node_modules/node-sass/vendor'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.getInstalledBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/extensions.js:130:13)
    at foundBinariesList (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/media/sf_CakeTest/node_modules/node-sass/lib/binding.js:15:30)
    at Object. (/media/sf_CakeTest/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object. (/media/sf_CakeTest/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18

 @ ./resources/assets/sass/app.scss 4:14-266
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

 error  in ./resources/assets/sass/app.scss

Module build failed: ModuleBuildError: Module build failed: Error: ENOENT: no such file or directory, scandir '/media/sf_CakeTest/node_modules/node-sass/vendor'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.getInstalledBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/extensions.js:130:13)
    at foundBinariesList (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/media/sf_CakeTest/node_modules/node-sass/lib/binding.js:15:30)
    at Object. (/media/sf_CakeTest/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object. (/media/sf_CakeTest/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at runLoaders (/media/sf_CakeTest/node_modules/webpack/lib/NormalModule.js:195:19)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:170:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:27:11)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/media/sf_CakeTest/node_modules/webpack/lib/NormalModule.js:182:3)
    at NormalModule.build (/media/sf_CakeTest/node_modules/webpack/lib/NormalModule.js:275:15)
    at Compilation.buildModule (/media/sf_CakeTest/node_modules/webpack/lib/Compilation.js:157:10)
    at moduleFactory.create (/media/sf_CakeTest/node_modules/webpack/lib/Compilation.js:460:10)
    at factory (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:243:5)
    at applyPluginsAsyncWaterfall (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:94:13)
    at /media/sf_CakeTest/node_modules/tapable/lib/Tapable.js:268:11
    at NormalModuleFactory.params.normalModuleFactory.plugin (/media/sf_CakeTest/node_modules/webpack/lib/CompatibilityPlugin.js:52:5)
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/media/sf_CakeTest/node_modules/tapable/lib/Tapable.js:272:13)
    at resolver (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:69:10)
    at process.nextTick (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:196:7)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
                                                                                                                                                                                                                                                                                                                     Asset     Size  Chunks                    Chunk Names
/js/app.js  1.39 MB       0  [emitted]  [big]  /js/app

ERROR in ./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/lib??postcss!./node_modules/resolve-url-loader??ref--5-4!./node_modules/sass-loader/lib/loader.js??ref--5-5!./resources/assets/sass/app.scss
Module build failed: Error: ENOENT: no such file or directory, scandir '/media/sf_CakeTest/node_modules/node-sass/vendor'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.getInstalledBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/extensions.js:130:13)
    at foundBinariesList (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/media/sf_CakeTest/node_modules/node-sass/lib/binding.js:15:30)
    at Object. (/media/sf_CakeTest/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object. (/media/sf_CakeTest/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
 @ ./resources/assets/sass/app.scss 4:14-266
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

ERROR in ./resources/assets/sass/app.scss
Module build failed: ModuleBuildError: Module build failed: Error: ENOENT: no such file or directory, scandir '/media/sf_CakeTest/node_modules/node-sass/vendor'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.getInstalledBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/extensions.js:130:13)
    at foundBinariesList (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/media/sf_CakeTest/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/media/sf_CakeTest/node_modules/node-sass/lib/binding.js:15:30)
    at Object. (/media/sf_CakeTest/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object. (/media/sf_CakeTest/node_modules/sass-loader/lib/loader.js:3:14)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:13:17)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at runLoaders (/media/sf_CakeTest/node_modules/webpack/lib/NormalModule.js:195:19)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:170:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:27:11)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
    at /media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:173:18
    at loadLoader (/media/sf_CakeTest/node_modules/loader-runner/lib/loadLoader.js:36:3)
    at iteratePitchingLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (/media/sf_CakeTest/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
    at NormalModule.doBuild (/media/sf_CakeTest/node_modules/webpack/lib/NormalModule.js:182:3)
    at NormalModule.build (/media/sf_CakeTest/node_modules/webpack/lib/NormalModule.js:275:15)
    at Compilation.buildModule (/media/sf_CakeTest/node_modules/webpack/lib/Compilation.js:157:10)
    at moduleFactory.create (/media/sf_CakeTest/node_modules/webpack/lib/Compilation.js:460:10)
    at factory (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:243:5)
    at applyPluginsAsyncWaterfall (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:94:13)
    at /media/sf_CakeTest/node_modules/tapable/lib/Tapable.js:268:11
    at NormalModuleFactory.params.normalModuleFactory.plugin (/media/sf_CakeTest/node_modules/webpack/lib/CompatibilityPlugin.js:52:5)
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/media/sf_CakeTest/node_modules/tapable/lib/Tapable.js:272:13)
    at resolver (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:69:10)
    at process.nextTick (/media/sf_CakeTest/node_modules/webpack/lib/NormalModuleFactory.js:196:7)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
 @ ./resources/assets/sass/app.scss
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
CakePHP 3.x,Library & PlugIn & AddIn,困ったTT | 2018-12-07 (金) 13:31:02 |

editorconfig-eclipse

Posted by muchag | CakePHP 3.x,Eclipse,Library & PlugIn & AddIn | 2018-03-07 (水) 16:21:41

.editorconfig に対応するためのプラグイン。

CakePHP3 の コーディング規約 を調べていたら
.editorconfig なるものの存在を知った。

これを Eclipse で利用できるようになるプラグイン。

【環境】
editorconfig-eclipse: 0.3.0.201702161018 Beta
Eclipse:Oxygen (4.7)
EPP Marketplace Client:1.5.1.v20160929-1432
OS:Windows10 Pro 64bit
インストール

[ヘルプ]-[Eclipse マーケットプレース]
検索窓に「editorconfig」
「editorconfig-eclipse 0.x」がヒットするので [インストール]
ライセンスに同意して [完了]

警告:署名なしコンテンツを含むソフトウェアをインストールしています。
このソフトウェアの真正性または妥当性を実証できません。
インストールを続行しますか?

がーん。。。断念。 😥

CakePHP 3.x,Eclipse,Library & PlugIn & AddIn | 2018-03-07 (水) 16:21:41 |