2017-08-29 7 views
0

私はlaravelプロジェクトに取り組んでおり、スタイルシートを少し追加しようとしています。nam run * webpack.mix.ksの更新後に動作しません

しかし、私はこのことからwebpack.min.jsを変更する場合:

let mix = require('laravel-mix'); 

/* 
|-------------------------------------------------------------------------- 
| Mix Asset Management 
|------------------------------------------------------------------------- - 
| 
| Mix provides a clean, fluent API for defining some Webpack build steps 
| for your Laravel application. By default, we are compiling the Sass 
| file for the application as well as bundling up all the JS files. 
| 
*/ 

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

へ:

let mix = require('laravel-mix'); 

/* 
|-------------------------------------------------------------------------- 
| Mix Asset Management 
|------------------------------------------------------------------------- - 
| 
| Mix provides a clean, fluent API for defining some Webpack build steps 
| for your Laravel application. By default, we are compiling the Sass 
| file for the application as well as bundling up all the JS files. 
| 
*/ 

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

私のNPMが作業を停止します。これらの変更は、私は次のエラーを取得した後、私はNPMの実行DEVを実行しようとすると:

> @ dev /Applications/MAMP/htdocs/***.dev 
> npm run development 


> @ development /Applications/MAMP/htdocs/***.dev 
> 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. 
/bin/sh: yarn: command not found 
child_process.js:515 
    throw err; 
    ^

Error: Command failed: yarn add less-loader less --save 
/bin/sh: yarn: command not found 

    at checkExecSyncError (child_process.js:472:13) 
    at execSync (child_process.js:512:13) 
    at installDependencies (/Applications/MAMP/htdocs/***.dev/node_modules/laravel-mix/src/Verify.js:127:5) 
    at Function.dependency (/Applications/MAMP/htdocs/***.dev/node_modules/laravel-mix/src/Verify.js:103:13) 
    at Api.less (/Applications/MAMP/htdocs/***.dev/node_modules/laravel-mix/src/Api.js:113:16) 
    at Object.<anonymous> (/Applications/MAMP/htdocs/***.dev/webpack.mix.js:16:5) 
    at Module._compile (module.js:570:32) 
    at Object.Module._extensions..js (module.js:579:10) 
    at Module.load (module.js:487:32) 
    at tryModuleLoad (module.js:446:12) 

npm ERR! Darwin 16.6.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "development" 
npm ERR! node v6.11.2 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 
npm ERR! @ development: `cross-env 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 1 
npm ERR! 
npm ERR! Failed at the @ development script 'cross-env 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!  cross-env 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!  /Applications/MAMP/htdocs/***.dev/npm-debug.log 

npm ERR! Darwin 16.6.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev" 
npm ERR! node v6.11.2 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 
npm ERR! @ dev: `npm run development` 
npm ERR! Exit status 1 
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!  /Applications/MAMP/htdocs/***.dev/npm-debug.log 

私は問題が何であるかを知っていて、すでにNPMとlaravelミックスを再インストール試していません。また、NPMのキャッシュをクリア..

答えて

0

は、次のことを実行してみましょう:

npm install -g yarn 

そして、これを実行した後にまだ再び

+0

同じ問題を試してみてください。.. –

+0

あなたがそれを実行した後に何を得ていますか? – fppz

+0

あなたはnpmをグローバルに実行するように設定していますか?また、 "npm install yarn --save"を試してみてください。 – fppz

関連する問題