I
I
Ivan Ivanov2018-07-05 19:18:42
npm
Ivan Ivanov, 2018-07-05 19:18:42

Why error in Laravel Mix?

Hello. According to the video tutorial, I pulled the template on Laravel.
Laravel 5.4
Entered this code to compile js and css files into one file (webpack.mix.js file):

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.styles([
  'resources/assets/admin/bootstrap/css/bootstrap.min.css',
  'resources/assets/admin/font-awesome/4.5.0/css/font-awesome.min.css',
  'resources/assets/admin/ionicons/2.0.1/css/ionicons.min.css',
  'resources/assets/admin/dist/css/AdminLTE.min.css',
  'resources/assets/admin/dist/css/skins/_all-skins.min.css'
], 'public/css/admin.css');

mix.scripts([
  'resources/assets/admin/plugins/jQuery/jquery-2.2.3.min.js',
  'resources/assets/admin/bootstrap/js/bootstrap.min.js',
  'resources/assets/admin/plugins/slimScroll/jquery.slimscroll.min.js',
  'resources/assets/admin/plugins/fastclick/fastclick.js',
  'resources/assets/admin/plugins/dist/js/app.min.js',
  'resources/assets/admin/dist/js/demo.js',
], 'public/js/admin.js');
mix.copy('resources/assets/assets/bootstrap/fonts', 'public/fonts');

Then I went to the console and wrote this command: npm run dev
Then a lot of errors came out, here:
> @ dev /home/ssciiike/blog.glezer.ru
> npm run development


> @ development /home/ssciiike/blog.glezer.ru
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

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/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
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 logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ssciiike/.npm/_logs/2018-07-05T16_13_00_006Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ssciiike/.npm/_logs/2018-07-05T16_13_00_023Z-debug.log

I work on Linux Mint, the Project is hosted. I searched for a solution for a long time, but did not find it, I tried deleting the node_models folder, etc., but it did not help. Also, tell me how to install this folder back? or you can do without it

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question