環境
- PHP 7.4.4
- Laravel 7.5.1
- Node 12.16.1
- yarn 1.22.0
package.json
{
"private": true,
"scripts": {
"dev": "yarn 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": "yarn run development -- --watch",
"watch-poll": "yarn 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": "yarn 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"
},
"devDependencies": {
"axios": "^0.19",
"cross-env": "^7.0",
"laravel-mix": "^5.0.1",
"lodash": "^4.17.13",
"resolve-url-loader": "^3.1.0",
"sass": "^1.15.2",
"sass-loader": "^8.0.0"
}
}
問題
$ yarn run development
$ cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
Additional dependencies must be installed. This will only take a moment.
Running: npm install vue-template-compiler --save-dev --production=false
/bin/sh: npm: not found
私の環境ではnpm
コマンドは入ってないのでエラーとなりました。
laravel-mix
は vue-template-compiler
に依存してるのか...🤔
なんだか気持ち悪いがそれならそれで初めから同梱して欲しい。。
$ yarn add vue-template-compiler --dev --production=false
vue-template-compiler
入れて解決。
まぁないんだからそうですよね。
$ yarn run dev
yarn run v1.22.0
$ yarn run development
$ cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
98% after emitting SizeLimitsPlugin
DONE Compiled successfully in 6532ms 5:09:41 PM
Asset Size Chunks Chunk Names
/css/app.css 0 bytes /js/app [emitted] /js/app
/js/app.js 592 KiB /js/app [emitted] /js/app
Done in 18.62s