Задать вопрос
@DmitryLife

Почему возникает ошибка при npm run dev?

При выполнение команды "npm run dev" возникает следующая проблема:
> @ dev c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it                             
> npm run development                                                                          
                                                                                               
                                                                                               
> @ development c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it                     
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules 
                                                                                               
98% after emitting SizeLimitsPlugin                                                            
                                                                                               
 ERROR  Failed to compile with 2 errors                                                        
 error  in ./resources/sass/app.scss                                                           
                                                                                               
Module build failed (from ./node_modules/css-loader/index.js):                                 
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):           
ValidationError: Invalid options object. Sass Loader has been initialized using an options obje
 - options has an unknown property 'outputStyle'. These properties are valid:                  
   object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }        
    at validate (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\schema
    at Object.loader (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\s
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\webpack\lib\Norm
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\loader-runner\li
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\loader-runner\li
    at runSyncOrAsync (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\
    at iterateNormalLoaders (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_mo
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\loader-runner\li
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\enhanced-resolve
    at processTicksAndRejections (internal/process/task_queues.js:79:11)                       
                                                                                               
 error  in ./resources/sass/app.scss                                                           
                                                                                               
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):                             
ValidationError: Invalid options object. Sass Loader has been initialized using an options obje
 - options has an unknown property 'outputStyle'. These properties are valid:                  
   object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }        
    at validate (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\schema
    at Object.loader (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\s
                                                                                               
 @ ./resources/sass/app.scss 2:14-253                                                          
                                                                                               
     Asset      Size   Chunks             Chunk Names                                          
/js/app.js  1.41 MiB  /js/app  [emitted]  /js/app                                              
                                                                                               
ERROR in ./resources/sass/app.scss                                                             
Module build failed (from ./node_modules/css-loader/index.js):                                 
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):           
ValidationError: Invalid options object. Sass Loader has been initialized using an options obje
 - options has an unknown property 'outputStyle'. These properties are valid:                  
   object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }        
    at validate (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\schema
    at Object.loader (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\s
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\webpack\lib\Norm
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\loader-runner\li
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\loader-runner\li
    at runSyncOrAsync (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\
    at iterateNormalLoaders (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_mo
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\loader-runner\li
    at c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\enhanced-resolve
    at processTicksAndRejections (internal/process/task_queues.js:79:11)                       
 @ ./resources/sass/app.scss                                                                   
                                                                                               
ERROR in ./resources/sass/app.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):                             
ValidationError: Invalid options object. Sass Loader has been initialized using an options obje
 - options has an unknown property 'outputStyle'. These properties are valid:                  
   object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }        
    at validate (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\schema
    at Object.loader (c:\Programs\OpenServer\OSPanel\domains\localhost\korona-it\node_modules\s
 @ ./resources/sass/app.scss 2:14-253                                                          
npm ERR! code ELIFECYCLE                                                                       
npm ERR! errno 2                                                                               
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --p
npm ERR! Exit status 2                                                                         
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 abo
                                                                                               
npm ERR! A complete log of this run can be found in:                                           
npm ERR!     C:\Users\ACER\AppData\Roaming\npm-cache\_logs\2021-01-29T14_55_02_953Z-debug.log  
npm ERR! code ELIFECYCLE                                                                       
npm ERR! errno 2                                                                               
npm ERR! @ dev: `npm run development`                                                          
npm ERR! Exit status 2                                                                         
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 abo
                                                                                               
npm ERR! A complete log of this run can be found in:                                           
npm ERR!     C:\Users\ACER\AppData\Roaming\npm-cache\_logs\2021-01-29T14_55_03_001Z-debug.log


Не как не могу понять, что именно не так(
  • Вопрос задан
  • 1524 просмотра
Подписаться 1 Средний Комментировать
Решения вопроса 1
@DmitryLife Автор вопроса
Мне в итоге помогла переустановка sass-loader на более старую версию.
npm uninstall --save-dev sass-loader
npm install --save-dev sass-loader@7.1.0
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
delphinpro
@delphinpro
frontend developer
Ну написано же черным по белому:

options has an unknown property 'outputStyle'. These properties are valid:
object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }


нужно писать не
{
  outputStyle: 'compressed'
}

а
{
  sassOptions: {
    outputStyle: 'compressed'
  }
}
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы